-
Notifications
You must be signed in to change notification settings - Fork 7
ci: fix issues with job naming when sequences are involved #979
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -34,11 +34,13 @@ on: | |||||
| type: string | ||||||
| outputs: | ||||||
| fully-qualified-image-name: | ||||||
| value: ${{ jobs.sanitize-image-name.outputs.fully-qualified-image-name }} | ||||||
| value: ${{ jobs.sanitize-inputs.outputs.fully-qualified-image-name }} | ||||||
| image-basename: | ||||||
| value: ${{ jobs.sanitize-image-name.outputs.image-basename }} | ||||||
| value: ${{ jobs.sanitize-inputs.outputs.image-basename }} | ||||||
| digest: | ||||||
| value: ${{ jobs.merge-image.outputs.digest }} | ||||||
| runner-arch: | ||||||
| value: ${{ jobs.sanitize-inputs.outputs.runner-arch }} | ||||||
| secrets: | ||||||
| DOCKER_REGISTRY_USERNAME: | ||||||
| required: true | ||||||
|
|
@@ -48,21 +50,21 @@ on: | |||||
| permissions: {} | ||||||
|
|
||||||
| jobs: | ||||||
| sanitize-image-name: | ||||||
| sanitize-inputs: | ||||||
| name: 🧼 | ||||||
| uses: ./.github/workflows/wc-sanitize-image-name.yml | ||||||
| uses: ./.github/workflows/wc-sanitize-inputs.yml | ||||||
| with: | ||||||
| image-name: ${{ inputs.image-name }} | ||||||
| registry: ${{ inputs.registry }} | ||||||
| runner-labels: ${{ inputs.runner-labels }} | ||||||
|
|
||||||
| build-push: | ||||||
| name: ${{ matrix.runner }} | ||||||
| name: Build (${{ needs.sanitize-inputs.outputs.runner-arch }}) | ||||||
| strategy: | ||||||
| matrix: | ||||||
| runner: ${{ (startsWith(inputs.build-test-runner-labels, '[') && endsWith(inputs.build-test-runner-labels, ']')) && fromJson(inputs.build-test-runner-labels) || inputs.build-test-runner-labels }} | ||||||
| runs-on: ${{ matrix.runner }} | ||||||
| needs: sanitize-image-name | ||||||
| needs: sanitize-inputs | ||||||
| permissions: | ||||||
| contents: read | ||||||
| packages: write | ||||||
|
|
@@ -87,7 +89,7 @@ jobs: | |||||
| DOCKER_METADATA_SET_OUTPUT_ENV: false | ||||||
| id: metadata | ||||||
| with: | ||||||
| images: ${{ needs.sanitize-image-name.outputs.fully-qualified-image-name }} | ||||||
| images: ${{ needs.sanitize-inputs.outputs.fully-qualified-image-name }} | ||||||
| - name: Generate image label for devcontainer.metadata | ||||||
| run: | | ||||||
| set -Eeuo pipefail | ||||||
|
|
@@ -105,16 +107,14 @@ jobs: | |||||
| id: devcontainer-metadata | ||||||
| - run: echo "git-commit-epoch=$(git log -1 --pretty=%ct)" >> "$GITHUB_OUTPUT" | ||||||
| id: devcontainer-epoch | ||||||
| - run: echo "arch=$(echo "${RUNNER_ARCH}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" | ||||||
| id: devcontainer-arch | ||||||
| - uses: docker/build-push-action@263435318d21b8e681c14492fe198d362a7d2c83 # v6.18.0 | ||||||
| id: build-and-push | ||||||
| env: | ||||||
| SOURCE_DATE_EPOCH: ${{ steps.devcontainer-epoch.outputs.git-commit-epoch }} | ||||||
| with: | ||||||
| file: ${{ inputs.dockerfile }} | ||||||
| push: true | ||||||
| tags: ${{ needs.sanitize-image-name.outputs.fully-qualified-image-name }} | ||||||
| tags: ${{ needs.sanitize-inputs.outputs.fully-qualified-image-name }} | ||||||
| labels: | | ||||||
| ${{ steps.metadata.outputs.labels }} | ||||||
| ${{ steps.devcontainer-metadata.outputs.label }} | ||||||
|
|
@@ -130,19 +130,17 @@ jobs: | |||||
| DIGEST: ${{ steps.build-and-push.outputs.digest }} | ||||||
| - uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 | ||||||
| with: | ||||||
| name: digests-${{ needs.sanitize-image-name.outputs.image-basename }}-${{ steps.devcontainer-arch.outputs.arch }} | ||||||
| name: digests-${{ needs.sanitize-inputs.outputs.image-basename }}-${{ needs.sanitize-inputs.outputs.runner-arch }} | ||||||
|
||||||
| name: digests-${{ needs.sanitize-inputs.outputs.image-basename }}-${{ needs.sanitize-inputs.outputs.runner-arch }} | |
| name: digests-${{ needs.sanitize-inputs.outputs.image-basename }}-${{ matrix.runner }} |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -1,5 +1,5 @@ | ||||||
| --- | ||||||
| name: Sanitize Image Name | ||||||
| name: Sanitize Inputs | ||||||
|
|
||||||
| on: | ||||||
| workflow_call: | ||||||
|
|
@@ -15,31 +15,38 @@ on: | |||||
| type: string | ||||||
| outputs: | ||||||
| image-basename: | ||||||
| description: "The sanitized base name of the image (without registry or tag)" | ||||||
| description: "The sanitized base name of the image" | ||||||
|
||||||
| description: "The sanitized base name of the image" | |
| description: "The sanitized base name of the image (excluding registry and tag)" |
Copilot
AI
Oct 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This description no longer states that the tag and registry are excluded, which can lead to misuse when composing full image references. Suggest: The sanitized image name (repository path without registry or tag).
| description: "The sanitized name of the image" | |
| description: "The sanitized image name (repository path without registry or tag)" |
Copilot
AI
Oct 16, 2025
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The previous wording clarified that the tag was not included; current phrasing could imply tags are present. Suggest: The fully qualified image name including registry (no tag).
| description: "The fully qualified name of the image including registry" | |
| description: "The fully qualified image name including registry (no tag)" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Using a single runner-arch value from the sanitize job for every matrix entry can mislabel builds when matrix runners differ (e.g. mixing x64 and arm64), leading to misleading job names. Compute architecture within each matrix job (using RUNNER_ARCH) or incorporate matrix.runner into the name to ensure accuracy.