-
Notifications
You must be signed in to change notification settings - Fork 6
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GH Actions: restrict access to certain GH Actions #2016
Conversation
JaCoCo Test Coverage
|
These succeed b/c I'm in the VRO-RESTRICTED team:
Note the |
35bd80a
to
9cc027a
Compare
Great!. I have verified all the workflows in Yoom's comments. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
runs-on: ubuntu-latest | ||
steps: | ||
- id: checkUserMember | ||
# Only check for manual runs, not scheduled runs | ||
if: github.event_name == 'workflow_dispatch' | ||
uses: tspascoal/get-user-teams-membership@v2 | ||
with: | ||
username: ${{ github.actor }} | ||
team: 'vro-restricted' | ||
GITHUB_TOKEN: ${{ secrets.ACCESS_TOKEN_READ_TEAM }} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should this be setup as a reusable block?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I considered that, but there's 2 different versions. Maybe someone can refactor that later.
What was the problem?
Anyone on the current team are allowed to do potentially dangerous actions, such as deploy to prod, via GH Action workflows.
Associated tickets or Slack threads:
How does this fix it?
Only allow members of the VRO-RESTRICTED team to do potentially dangerous actions.
Affected workflows:
delete-old-releases.yml
delete-published-images.yml
delete-workflow-runs.yml
deploy-secrets.yml
- restricted only when deploying toprod
update-deployment.yml
- restricted only when deploying toprod
How to test this PR
If you are not in VRO-RESTRICTED, then the above GH Action workflows should fail (when run on this PR's branch
yoom/restrict-access
) with aOnly VRO-RESTRICTED team members can run this action
message.