From 24ecbf048b0f6b65b8d0097427e04a0973d02118 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 | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/.github/workflows/build_pkg.yml b/.github/workflows/build_pkg.yml index dfe3c45..043416b 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,11 @@ jobs: repository: ${{ inputs.repository }} ref: ${{ inputs.ref }} path: input + - name: check if HEAD contains tag + 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