Skip to content

Commit

Permalink
Move to environment for approvals
Browse files Browse the repository at this point in the history
  • Loading branch information
mkjpryor committed Nov 27, 2023
1 parent 95180f0 commit 6c8f477
Showing 1 changed file with 5 additions and 12 deletions.
17 changes: 5 additions & 12 deletions .github/workflows/test-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,23 +18,16 @@ jobs:
- name: PR must be from a branch in the stackhpc/ansible-collection-azimuth-ops repo
run: exit ${{ github.repository == 'stackhpc/ansible-collection-azimuth-ops' && '0' || '1' }}

# Because of resource constraints, we want to restrict concurrency:
#
#  * Only one active workflow run at a time across all branches, others should be queued
# * New workflow runs should cancel any in-progress runs for the same branch only
#
# The GitHub native concurrency cannot express this, so we use a custom action to queue
# This will wait for an available slot until the action times out or is cancelled
wait_in_queue:
# Use a job that does nothing but is protected by an environment as a guard
wait_for_approval:
needs: [fail_on_remote]
if: ${{ !github.event.pull_request.draft }}
runs-on: ubuntu-latest
environment: ci-approval
steps:
- name: Wait for an available slot
uses: stackhpc/github-actions/workflow-concurrency@master
- run: exit 0

run_azimuth_tests:
needs: [wait_in_queue]
needs: [wait_for_approval]
runs-on: ubuntu-latest
steps:
# Check out the configuration repository
Expand Down

0 comments on commit 6c8f477

Please sign in to comment.