From aee691d7bc2cde537303341321ed0e808bde42a6 Mon Sep 17 00:00:00 2001 From: Jakub Stejskal Date: Sat, 14 Nov 2026 19:57:54 +0100 Subject: [PATCH] Determine githubActionsRef automatically Signed-off-by: Jakub Stejskal --- .github/actionlint.yaml | 7 ++++++- .github/workflows/reusable-test-integrations.yml | 14 +++++++------- README.md | 7 +++---- 3 files changed, 16 insertions(+), 12 deletions(-) diff --git a/.github/actionlint.yaml b/.github/actionlint.yaml index 4686d09..ba91832 100644 --- a/.github/actionlint.yaml +++ b/.github/actionlint.yaml @@ -11,4 +11,9 @@ self-hosted-runner: - cncf-ubuntu-8-32-x86 - cncf-ubuntu-2-8-arm - cncf-ubuntu-4-16-arm - - cncf-ubuntu-8-32-arm \ No newline at end of file + - cncf-ubuntu-8-32-arm +paths: + .github/workflows/reusable-test-integrations.yml: + ignore: + # job.workflow_sha is supported by GitHub (runner >= v2.334.0) but not yet known to actionlint + - 'property "workflow_sha" is not defined in object type' diff --git a/.github/workflows/reusable-test-integrations.yml b/.github/workflows/reusable-test-integrations.yml index 96f9384..d853f7a 100644 --- a/.github/workflows/reusable-test-integrations.yml +++ b/.github/workflows/reusable-test-integrations.yml @@ -62,7 +62,7 @@ on: type: boolean default: true githubActionsRef: - description: "Ref of strimzi/github-actions to use (tag, branch, or SHA). Leave empty for local calls within github-actions repo." + description: "Optional override of the strimzi/github-actions ref (tag, branch, or SHA). Defaults to the same commit as this reusable workflow (job.workflow_sha)." required: false type: string default: "" @@ -100,7 +100,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: strimzi/github-actions - ref: ${{ inputs.githubActionsRef || github.sha }} + ref: ${{ inputs.githubActionsRef || job.workflow_sha }} path: github-actions persist-credentials: false @@ -199,7 +199,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: strimzi/github-actions - ref: ${{ inputs.githubActionsRef || github.sha }} + ref: ${{ inputs.githubActionsRef || job.workflow_sha }} path: github-actions persist-credentials: false @@ -321,7 +321,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: strimzi/github-actions - ref: ${{ inputs.githubActionsRef || github.sha }} + ref: ${{ inputs.githubActionsRef || job.workflow_sha }} path: github-actions persist-credentials: false @@ -366,7 +366,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: strimzi/github-actions - ref: ${{ inputs.githubActionsRef || github.sha }} + ref: ${{ inputs.githubActionsRef || job.workflow_sha }} path: github-actions persist-credentials: false @@ -435,7 +435,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: strimzi/github-actions - ref: ${{ inputs.githubActionsRef || github.sha }} + ref: ${{ inputs.githubActionsRef || job.workflow_sha }} path: github-actions persist-credentials: false @@ -532,7 +532,7 @@ jobs: uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 with: repository: strimzi/github-actions - ref: ${{ inputs.githubActionsRef || github.sha }} + ref: ${{ inputs.githubActionsRef || job.workflow_sha }} path: github-actions persist-credentials: false diff --git a/README.md b/README.md index 02b2317..79a7bef 100644 --- a/README.md +++ b/README.md @@ -196,9 +196,9 @@ In case we do update `push-container` or `release` flows in respective repositor The result will be shown only in tests within `github-actions` repository, because it tests flow for all parts of build process. To mitigate this, we have to run the same integration tests we have in this repository also in other repositories, just with different configurations. -The main difference is in `githubActionsRef` parameter. -This parameter says which branch of `github-actions` repo will be used for running the tests which should align with branch or version used in build/release workflows. -So for example in case we use version `1.0.0` in build workflow, we should keep the same in the tests to ensure that current actions will work with new changes. +The reusable workflow automatically checks out the actions from the same commit of `github-actions` repo as the one referenced in `uses:` (via `job.workflow_sha`). +That means bumping the version of the reusable workflow (e.g., by Dependabot/Renovate) is enough to keep the tested actions aligned with the version used in build/release workflows. +The optional `githubActionsRef` parameter overrides this ref. Callers normally should not set it, use it only when you explicitly need to test a different ref of the actions. The following code snippet shows the workflow for Bridge repository: @@ -238,7 +238,6 @@ jobs: releaseVersion: "6.6.6" imagesLocation: "kafka-bridge-amd64.tar.gz" clusterOperatorBuild: false - githubActionsRef: "1.0.0" secrets: inherit ```