-
Notifications
You must be signed in to change notification settings - Fork 62
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a12363a
commit 22bb392
Showing
2 changed files
with
31 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
name: Check for Label | ||
|
||
on: | ||
issues: | ||
types: [labeled] | ||
|
||
jobs: | ||
check-label: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check if label exists | ||
id: check_label | ||
uses: actions/github-script@v6 | ||
with: | ||
script: | | ||
const label = 'your-label-name'; | ||
const labels = context.payload.issue.labels.map(l => l.name); | ||
return labels.includes(label); | ||
- name: Set output | ||
id: set_output | ||
run: echo "LABEL_EXISTS=${{ steps.check_label.outputs.result }}" >> $GITHUB_ENV | ||
|
||
- name: Label exists | ||
if: env.LABEL_EXISTS == 'true' | ||
run: echo "Label exists." | ||
|
||
- name: Label does not exist | ||
if: env.LABEL_EXISTS == 'false' | ||
run: echo "Label does not exist." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters