Skip to content

Commit

Permalink
Fix the label-on-approval workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
necolas committed May 18, 2024
1 parent ea93288 commit 9beca5d
Show file tree
Hide file tree
Showing 2 changed files with 32 additions and 24 deletions.
24 changes: 0 additions & 24 deletions .github/workflows/add-label-run-extended-tests-approve.yml

This file was deleted.

32 changes: 32 additions & 0 deletions .github/workflows/after-approval.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: After Approval

on:
pull_request_review:
types: [submitted]
pull_request_target:
types: [review_requested, opened, reopened, synchronize]
branches:
- 'main'

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
label-pr:
if: github.event.review.state == 'approved' && !contains(github.event.pull_request.labels.*.name, 'extended-tests')
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Add label for extended tests
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
run: |
echo "Adding label 'extended-tests' to PR $NUMBER"
gh pr edit "$NUMBER" --add-label "extended-tests" || (echo "Failed to add label" && exit 1)
e2e-tests:
needs: label-pr
uses: ./.github/workflows/call-e2e-all-tests.yml

0 comments on commit 9beca5d

Please sign in to comment.