Skip to content

Commit

Permalink
test permission
Browse files Browse the repository at this point in the history
  • Loading branch information
sixianyi0721 committed Jan 23, 2025
1 parent 328f941 commit 898157a
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@

# These owners will be the default owners for everything in
# the repo. Unless a later match takes precedence,
* @ashwinb @yanxi0830 @hardikjshah @dltn @raghotham @dineshyv @vladimirivic @sixianyi0721
* @ashwinb @yanxi0830 @hardikjshah @dltn @raghotham @dineshyv @vladimirivic
13 changes: 12 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: auto-tests

on:
# pull_request:
pull_request:
workflow_dispatch:
inputs:
commit_sha:
Expand All @@ -20,6 +20,17 @@ jobs:
matrix:
provider: [fireworks, together]
steps:
- name: Check user permission
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
CODEOWNERS=$(gh api /repos/${{ github.repository }}/codeowners | jq -r '.owners[]')
if [[ ! " ${CODEOWNERS[@]} " =~ " ${{ github.actor }} " ]]; then
echo "Only codeowners can trigger this workflow ${{ github.actor }} ${CODEOWNERS[@]}"
exit 1
fi
- uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.commit_sha }}
Expand Down

0 comments on commit 898157a

Please sign in to comment.