Skip to content

Commit

Permalink
Add check permissions action
Browse files Browse the repository at this point in the history
  • Loading branch information
aacic committed May 29, 2024
1 parent f5768c3 commit b18e675
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
9 changes: 6 additions & 3 deletions .github/actions/check-user-permissions/action.yml
Original file line number Diff line number Diff line change
@@ -1,19 +1,22 @@
name: 'Check user permissions'
description: 'Checks whether the user has write permission'
inputs:
INPUT_BUILD_SECRET:
description: 'Input build secret'
required: true
BUILD_SECRET:
description: 'BUILD secret'
description: 'Build secret'
required: true
GITHUB_TOKEN:
description: 'GITHUB TOKEN'
description: 'Github token'
required: true
runs:
using: 'composite'
steps:
- name: Check secret
shell: bash
run: |
if [ "${{ inputs.BUILD_SECRET }}" != "${{ secrets.BUILD_SECRET }}" ]; then
if [ "${{ inputs.INPUT_BUILD_SECRET }}" != "${{ input.BUILD_SECRET }}" ]; then
echo "Wrong build secret."
exit 1
fi
Expand Down
3 changes: 2 additions & 1 deletion .github/workflows/CD-publish-rust-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,5 +15,6 @@ jobs:
- name: Check user permission
uses: stjude/proteinpaint/.github/actions/check-user-permissions@new-workflows
with:
BUILD_SECRET: ${{ github.event.inputs.build_secret }}
BUILD_SECRET: ${{ secrets.BUILD_SECRET }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
INPUT_BUILD_SECRET: ${{ github.event.inputs.build_secret }}

0 comments on commit b18e675

Please sign in to comment.