Skip to content

Commit

Permalink
DEVOPS-1891 - Fix enforce labels workflow (#268)
Browse files Browse the repository at this point in the history
  • Loading branch information
vgrassia authored Mar 19, 2024
1 parent 7519981 commit 4faa0f2
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/workflows/enforce-labels.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,20 @@ on:
workflow_call:
pull_request:
types: [labeled, unlabeled, opened, reopened, synchronize]

jobs:
enforce-label:
if: ${{ contains(github.event.*.labels.*.name, 'hold') || contains(github.event.*.labels.*.name, 'needs-qa') }}
name: Enforce label
runs-on: ubuntu-22.04

steps:
- name: Check for label
env:
LABEL_HOLD: ${{ contains(github.event.*.labels.*.name, 'hold') }}
LABEL_NEEDS_QA: ${{ contains(github.event.*.labels.*.name, 'needs-qa') }}
run: |
echo "PRs with the hold or needs-qa labels cannot be merged"
echo "### :x: PRs with the hold or needs-qa labels cannot be merged" >> $GITHUB_STEP_SUMMARY
exit 1
if [[ "$LABEL_HOLD" = "true" ]] || [[ "$LABEL_NEEDS_QA" = "true" ]]; then
echo "PRs with the hold or needs-qa labels cannot be merged"
echo "### :x: PRs with the hold or needs-qa labels cannot be merged" >> $GITHUB_STEP_SUMMARY
exit 1
fi

0 comments on commit 4faa0f2

Please sign in to comment.