Skip to content

Commit

Permalink
check required labels
Browse files Browse the repository at this point in the history
  • Loading branch information
sam0x17 committed Apr 21, 2024
1 parent d99b4ac commit 42de56e
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions .github/workflows/check-labels.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: Check Required Labels
on:
pull_request:
types: [opened, synchronize, labeled, unlabeled]

workflow_dispatch:

jobs:
devnet-pass:
name: Tested successfully on devnet
runs-on: ubuntu-latest
steps:
- name: Check for Required Label
run: |
REQUIRED_LABEL="devnet-pass"
PR_LABELS="${{ toJSON(github.event.pull_request.labels) }}"
if echo "$PR_LABELS" | grep -q "\"name\":\"$REQUIRED_LABEL\""; then
echo "Required label '$REQUIRED_LABEL' is present."
else:
echo "Error: Required label '$REQUIRED_LABEL' is missing."
exit 1
testnet-pass:
name: Tested successfully on testnet
runs-on: ubuntu-latest
steps:
- name: Check for Required Label
run: |
REQUIRED_LABEL="testnet-pass"
PR_LABELS="${{ toJSON(github.event.pull_request.labels) }}"
if echo "$PR_LABELS" | grep -q "\"name\":\"$REQUIRED_LABEL\""; then
echo "Required label '$REQUIRED_LABEL' is present."
else:
echo "Error: Required label '$REQUIRED_LABEL' is missing."
exit 1

0 comments on commit 42de56e

Please sign in to comment.