From f5749121accd2e18ab48e94527e344f5d8230082 Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:00:25 -0400 Subject: [PATCH 1/2] Add build workflow Runs initialize-variables and checks its outputs. Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- .github/workflows/build.yaml | 43 ++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/build.yaml diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml new file mode 100644 index 0000000..d7e5927 --- /dev/null +++ b/.github/workflows/build.yaml @@ -0,0 +1,43 @@ +name: Build Status + +on: + push: + branches: + - main + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +permissions: + contents: read + +jobs: + build: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + with: + persist-credentials: false + fetch-depth: 2 + + - name: Initialize variables + id: vars + uses: ./initialize-variables + + - name: Verify outputs + run: | + echo "COMMIT_MESSAGE=$COMMIT_MESSAGE" + echo "FULL_BUILD=$FULL_BUILD" + test -n "$COMMIT_MESSAGE" + case "$FULL_BUILD" in + true|false) ;; + *) echo "FULL_BUILD is not a boolean"; exit 1 ;; + esac + shell: bash + env: + COMMIT_MESSAGE: ${{ steps.vars.outputs.COMMIT_MESSAGE }} + FULL_BUILD: ${{ steps.vars.outputs.FULL_BUILD }} From c2ea5892cddff4132c9158a100deb4851afedffd Mon Sep 17 00:00:00 2001 From: Tim Paine <3105306+timkpaine@users.noreply.github.com> Date: Tue, 1 Sep 2026 12:08:01 -0400 Subject: [PATCH 2/2] Fix initialize-variables outputs and event guards The COMMIT_MESSAGE output referenced a step id that does not exist, so it was always empty. The push step's if: was nested under env:, so it ran on every event and shadowed the pull request path. The manual path read HEAD^2, which does not resolve on a branch head. Signed-off-by: Tim Paine <3105306+timkpaine@users.noreply.github.com> --- initialize-variables/action.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/initialize-variables/action.yml b/initialize-variables/action.yml index 244340f..df74573 100644 --- a/initialize-variables/action.yml +++ b/initialize-variables/action.yml @@ -11,7 +11,7 @@ inputs: outputs: COMMIT_MESSAGE: description: "Latest commit message" - value: ${{ steps.setup.outputs.COMMIT_MSG }} + value: ${{ steps.setuppush.outputs.COMMIT_MSG || steps.setuppr.outputs.COMMIT_MSG || steps.setupmanual.outputs.COMMIT_MSG }} FULL_BUILD: description: "Whether to do a full build" value: ${{ steps.setuppush.outputs.FULL_BUILD || steps.setuppr.outputs.FULL_BUILD || steps.setupmanual.outputs.FULL_BUILD }} @@ -32,7 +32,7 @@ runs: - name: Get Commit Message shell: bash - run: echo "COMMIT_MSG=$(git log -1 --pretty=%B HEAD^2 | tr '\n' ' ')" >> $GITHUB_ENV + run: echo "COMMIT_MSG=$(git log -1 --pretty=%B HEAD | tr '\n' ' ')" >> $GITHUB_ENV if: ${{ github.event_name == 'workflow_dispatch' }} - name: Display and Setup Build Args (Push) @@ -45,7 +45,7 @@ runs: echo "FULL_BUILD=$FULL_BUILD" >> $GITHUB_OUTPUT env: FULL_BUILD: ${{ startsWith(github.ref_name, 'v') || contains(github.event.head_commit.message, '[ci-full]') || contains(env.COMMIT_MSG, '[ci-full]') }} - if: ${{ github.event_name == 'push' }} + if: ${{ github.event_name == 'push' }} - name: Display and Setup Build Args (PR) id: setuppr