Skip to content
This repository was archived by the owner on Sep 12, 2024. It is now read-only.

Commit f67207f

Browse files
committed
feat(action): using another action #1
1 parent e9b3d05 commit f67207f

File tree

2 files changed

+7
-26
lines changed

2 files changed

+7
-26
lines changed

.github/workflows/community.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ jobs:
88
welcome:
99
runs-on: ubuntu-latest
1010
steps:
11+
- uses: actions/first-interaction@v1
12+
with:
13+
repo-token: ${{ secrets.GITHUB_TOKEN }}
14+
issue-message: '# Congratulations :tada:\nThis is your first **Issue**! Welcome to the community :nerd:'
15+
pr-message: '# Congratulations :tada:\nThis is your first **Pull Request**! Welcome to the community :nerd:'
1116
- uses: EddieJaoudeCommunity/gh-action-community@main
1217
with:
1318
github-token: ${{ secrets.GITHUB_TOKEN }}

index.js

Lines changed: 2 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -3,33 +3,9 @@ const github = require('@actions/github');
33

44
(async () => {
55
try {
6-
const githubSecret = core.getInput('github-token', { required: true });
7-
const client = new github.GitHub(githubSecret);
6+
// const githubSecret = core.getInput('github-token', { required: true });
87

9-
const creator = github.context.payload.sender.login;
10-
const opts = client.issues.listForRepo({
11-
...github.context.issue,
12-
creator,
13-
state: 'all',
14-
});
15-
const issues = await github.paginate(opts);
16-
17-
for (const issue of issues) {
18-
if (issue.number === github.context.issue.number) {
19-
continue;
20-
}
21-
22-
if (issue.pull_request) {
23-
return; // Creator is already a contributor.
24-
}
25-
}
26-
27-
await repo.issues.createComment({
28-
issue_number: github.context.issue.number,
29-
owner: github.context.github.owner,
30-
repo: github.context.github.repo,
31-
body: 'Welcome, new contributor!',
32-
});
8+
console.log('HERE');
339
} catch (error) {
3410
core.setFailed(error.message);
3511
}

0 commit comments

Comments
 (0)