Skip to content

Commit

Permalink
Move to custom action (#57)
Browse files Browse the repository at this point in the history
  • Loading branch information
whscullin authored Jan 6, 2025
1 parent 65215fb commit 65df47e
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 15 deletions.
16 changes: 16 additions & 0 deletions .github/actions/permission-check.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
steps:
- name: Get User Permission
id: checkAccess
uses: actions-cool/check-user-permission@v2
with:
require: write
username: ${{ github.triggering_actor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check User Permission
if: steps.checkAccess.outputs.require-result == 'false'
run: |
echo "${{ github.triggering_actor }} does not have permissions on this repo."
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
echo "Job originally triggered by ${{ github.actor }}"
exit 1
16 changes: 1 addition & 15 deletions .github/workflows/test.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,10 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Get User Permission
id: checkAccess
uses: actions-cool/check-user-permission@v2
with:
require: write
username: ${{ github.triggering_actor }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Check User Permission
if: steps.checkAccess.outputs.require-result == 'false'
run: |
echo "${{ github.triggering_actor }} does not have permissions on this repo."
echo "Current permission level is ${{ steps.checkAccess.outputs.user-permission }}"
echo "Job originally triggered by ${{ github.actor }}"
exit 1
- uses: actions/checkout@v4
with:
submodules: 'true'
- uses: ./.github/actions/permission-check
- name: GCloud auth
uses: 'google-github-actions/auth@v2'
with:
Expand Down

0 comments on commit 65df47e

Please sign in to comment.