From 9d7f097da76c1751dac732bb553943325f766118 Mon Sep 17 00:00:00 2001 From: Andrew Lee Date: Mon, 27 Nov 2023 15:24:44 +0100 Subject: [PATCH] Building package only if it's tagged. --- .github/workflows/build_pkg.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index dfe3c45..2946880 100644 --- a/.github/workflows/build_pkg.yml +++ b/.github/workflows/build_pkg.yml @@ -32,6 +32,10 @@ on: message: type: string default: "" + +env: + GH_TOKEN: ${{ github.token }} + jobs: source: name: source package @@ -51,6 +55,12 @@ jobs: repository: ${{ inputs.repository }} ref: ${{ inputs.ref }} path: input + - name: check if HEAD contains tag + needs: test + if: github.ref_type !== 'tag' + run: | + echo "Commit is not tagged. Cancel the workflow!" + gh run cancel ${{ github.run_id }} - name: pull build container run: podman pull "${{ inputs.build_container }}:amd64" - name: fetch dependencies