Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 23 additions & 3 deletions .github/workflows/contrib.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,6 @@ jobs:
with:
ref: master

- name: Credit contributor
run: python3 scripts/contrib.py "$CONTRIBUTOR" --release "$RELEASE"

- name: Generate token
id: app-token
uses: actions/create-github-app-token@64ab729a6294000f5aa4a4bc0b73d1f32bc45510 # v3.3.0
Expand All @@ -50,8 +47,31 @@ jobs:
private-key: ${{ secrets.SDK_MAINTAINER_BOT_PRIVATE_KEY }}
permission-contents: write
permission-pull-requests: write
permission-members: read

- name: Check membership
id: membership
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.app-token.outputs.token }}
script: |
try {
await github.rest.orgs.checkMembershipForUser({
org: context.repo.owner,
username: process.env.CONTRIBUTOR.replace(/^@/, ''),
});
core.setOutput('external', false);
} catch (error) {
if (error.status !== 404) throw error;
core.setOutput('external', true);
}

- name: Credit contributor
if: steps.membership.outputs.external == 'true'
run: python3 scripts/contrib.py "$CONTRIBUTOR" --release "$RELEASE"

- name: Create PR
if: steps.membership.outputs.external == 'true'
uses: peter-evans/create-pull-request@5f6978faf089d4d20b00c7766989d076bb2fc7f1 # v8.1.1
with:
token: ${{ steps.app-token.outputs.token }}
Expand Down
Loading