From 92b81882b5e5a67da07211aa997f61f7d9f94be7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=2E=20Fatih=20C=C4=B1r=C4=B1t?= Date: Thu, 13 Jun 2024 18:28:13 +0300 Subject: [PATCH] feat(make-sure-label-is-present): new workflow (#301) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: M. Fatih Cırıt --- .../workflows/make-sure-label-is-present.yaml | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 .github/workflows/make-sure-label-is-present.yaml diff --git a/.github/workflows/make-sure-label-is-present.yaml b/.github/workflows/make-sure-label-is-present.yaml new file mode 100644 index 00000000..d7305344 --- /dev/null +++ b/.github/workflows/make-sure-label-is-present.yaml @@ -0,0 +1,31 @@ +name: make-sure-label-is-present + +on: + workflow_call: + inputs: + label: + required: true + type: string + outputs: + result: + 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.result }} + steps: + - name: Check if label is present + 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: Skip if label is not present + 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