-
-
Notifications
You must be signed in to change notification settings - Fork 1.6k
50 lines (45 loc) · 1.88 KB
/
external-contributors.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
name: "CI: Mention external contributors"
on:
pull_request_target:
types:
- closed
branches:
- develop
jobs:
external_contributor:
name: External Contributors
permissions:
pull-requests: write
contents: write
runs-on: ubuntu-20.04
if: |
github.event.pull_request.merged == true
&& github.event.pull_request.author_association != 'COLLABORATOR'
&& github.event.pull_request.author_association != 'MEMBER'
&& github.event.pull_request.author_association != 'OWNER'
&& endsWith(github.event.pull_request.user.login, '[bot]') == false
steps:
- uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version-file: 'package.json'
- name: Install dependencies
run: yarn install --frozen-lockfile
- name: Add external contributor to CHANGELOG.md
uses: ./dev-packages/external-contributor-gh-action
with:
name: ${{ github.event.pull_request.user.login }}
author_association: ${{ github.event.pull_request.author_association }}
- name: Create PR with changes
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
with:
# This token is scoped to Daniel Griesser
# If we used the default GITHUB_TOKEN, the resulting PR would not trigger CI :(
token: ${{ secrets.REPO_SCOPED_TOKEN }}
commit-message: "chore: Add external contributor to CHANGELOG.md"
title: "chore: Add external contributor to CHANGELOG.md"
branch: 'external-contributor/patch-${{ github.event.pull_request.user.login }}'
base: 'develop'
delete-branch: true
body: "This PR adds the external contributor to the CHANGELOG.md file, so that they are credited for their contribution. See #${{ github.event.pull_request.number }}"