Skip to content

Commit 4c74815

Browse files
authored
Add custom token to community contributions workflow (#64)
The pause-community-contributions workflow makes a call to the GitHub API to check if the person contributing is a member of the organization. However, this call currently fails if the contributor has set their membership to 'private'. This is because the default token provided for GitHub Actions only has permissions for the repository, not for the organization. With this token, we're not allowed to see private memberships. We've created a custom, org-wide secret containing a personal token that has permissions to read organization membership. Unfortunately the secret cannot be accessed directly by the shared workflow, it has to be passed in. We updated the shared workflow to use the token, if it is provided, and this PR updates the workflow in this repo to pass the secret. Until this is merged, contributions from people with private membership in the Exercism organization will be automatically closed. Note that this PR also removes the workflow_dispatch which fails if you try to use it.
1 parent 7a6669e commit 4c74815

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

.github/workflows/pause-community-contributions.yml

+2-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ on:
77
pull_request_target:
88
types:
99
- opened
10-
workflow_dispatch:
1110

1211
permissions:
1312
issues: write
@@ -19,3 +18,5 @@ jobs:
1918
uses: exercism/github-actions/.github/workflows/community-contributions.yml@main
2019
with:
2120
forum_category: support
21+
secrets:
22+
github_membership_token: ${{ secrets.COMMUNITY_CONTRIBUTIONS_WORKFLOW_TOKEN }}

0 commit comments

Comments
 (0)