aboutsummaryrefslogtreecommitdiffstats
path: root/.github
diff options
context:
space:
mode:
authorLibravatar Vijay A <avijayr@protonmail.com>2021-06-23 16:53:52 +0530
committerLibravatar Vijay Raghavan Aravamudhan <vraravam@users.noreply.github.com>2021-06-23 16:54:28 +0530
commita420ac430758a92b0e2c0ca6f74fc516af05ee0a (patch)
treee18ccdc0a435acce4c148d8db3af8ab43d327966 /.github
parentAdded new services (diff)
downloadferdium-recipes-a420ac430758a92b0e2c0ca6f74fc516af05ee0a.tar.gz
ferdium-recipes-a420ac430758a92b0e2c0ca6f74fc516af05ee0a.tar.zst
ferdium-recipes-a420ac430758a92b0e2c0ca6f74fc516af05ee0a.zip
Added new GH Actions workflow to welcome first time contributors. [skip ci]
Diffstat (limited to '.github')
-rw-r--r--.github/workflows/ferdi-recipes-first-time-contributor.yml40
1 files changed, 40 insertions, 0 deletions
diff --git a/.github/workflows/ferdi-recipes-first-time-contributor.yml b/.github/workflows/ferdi-recipes-first-time-contributor.yml
new file mode 100644
index 0000000..7a1382a
--- /dev/null
+++ b/.github/workflows/ferdi-recipes-first-time-contributor.yml
@@ -0,0 +1,40 @@
1# Copied from: https://awesomeopensource.com/project/actions/github-script?categoryPage=7
2
3name: Welcome first time contributors
4
5on: pull_request
6
7jobs:
8 welcome:
9 runs-on: ubuntu-latest
10 steps:
11 - uses: actions/github-script@v4
12 with:
13 github-token: ${{ secrets.GITHUB_TOKEN }}
14 script: |
15 // Get a list of all issues created by the PR opener
16 // See: https://octokit.github.io/rest.js/#pagination
17 const creator = context.payload.sender.login
18 const opts = github.issues.listForRepo.endpoint.merge({
19 ...context.issue,
20 creator,
21 state: 'all'
22 })
23 const issues = await github.paginate(opts)
24
25 for (const issue of issues) {
26 if (issue.number === context.issue.number) {
27 continue
28 }
29
30 if (issue.pull_request) {
31 return // Creator is already a contributor.
32 }
33 }
34
35 await github.issues.createComment({
36 issue_number: context.issue.number,
37 owner: context.repo.owner,
38 repo: context.repo.repo,
39 body: `Welcome, ${ creator }! Thanks for contributing to Ferdi!`
40 })