-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(make-sure-label-is-present): new workflow
Signed-off-by: M. Fatih Cırıt <[email protected]>
- Loading branch information
M. Fatih Cırıt
committed
Jun 12, 2024
1 parent
2e9b0b4
commit 15fc5c9
Showing
1 changed file
with
31 additions
and
0 deletions.
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,31 @@ | ||
name: make-sure-label-is-present | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
label: | ||
required: true | ||
type: string | ||
outputs: | ||
run: | ||
value: ${{ jobs.make-sure-label-is-present.outputs.result }} | ||
|
||
jobs: | ||
make-sure-label-is-present: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
result: ${{ steps.make-sure-label-is-present.outputs.run }} | ||
steps: | ||
- name: Check if label exists | ||
id: make-sure-label-is-present | ||
if: contains(github.event.pull_request.labels.*.name, '${{ inputs.label }}') | ||
run: | | ||
echo "result=true" >> $GITHUB_OUTPUT | ||
shell: bash | ||
|
||
- name: Fail the job | ||
if: steps.make-sure-label-is-present.outputs.result != 'true' | ||
run: | | ||
echo "Please add the label '${{ inputs.label }}' to run this workflow." | ||
echo "result=false" >> $GITHUB_OUTPUT | ||
shell: bash |