Skip to content

Commit

Permalink
Add comment when not authorized, ensure state is passed to createNewR…
Browse files Browse the repository at this point in the history
…epo job
  • Loading branch information
hvidy committed Feb 14, 2024
1 parent c122dbc commit a20b84f
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/templates/unauthorized-approval.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
### Unauthorized Approval ❌

Only members of the @model_reviewers team are able to approve model submissions.
11 changes: 10 additions & 1 deletion .github/workflows/approve-label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,8 @@ jobs:
createRepoAuthorization:
if: contains(github.event.label.name, 'approved')
runs-on: ubuntu-latest
outputs:
authorized: ${{ steps.verify_labeler.outputs.authorized }}
steps:
- name: Checkout
uses: actions/checkout@v4
Expand All @@ -96,9 +98,16 @@ jobs:
AUTHORIZED=$(python3 .github/scripts/approval_authorization.py)
echo "authorized=${AUTHORIZED}" >> $GITHUB_OUTPUT
- name: comment if unauthorized
if: ${{ steps.verify_labeler.outputs.authorized }} == "False"
uses: GrantBirki/comment@v2.0.8
with:
issue-number: ${{ github.event.issue.number }}
file: .github/templates/unauthoriszed-approval.md

createNewRepo:
needs: createRepoAuthorization
if: ${{ needs.createRepoAuthorization.outputs.create_repo }} == "True"
if: ${{ needs.createRepoAuthorization.outputs.authorized }} == "True"
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down

0 comments on commit a20b84f

Please sign in to comment.