Conversation
…s and digest management
|
@codex review |
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Tip Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord. Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In @.github/workflows/docker-publish.yml:
- Around line 58-64: The workflow fails because GitHub Actions expressions don't
have replace(), so change the artifact name usage in the Upload digest step (the
actions/upload-artifact@v4 step where name: digests-${{ replace(matrix.platform,
'/', '-') }}) — either add a small prior step that computes a sanitized platform
variable via shell (e.g., export PLATFORM_NAME="${{ matrix.platform }}" with
parameter substitution to replace "/" with "-" and then reference that env var
in the upload step), or add a platform_name field to the matrix (e.g.,
matrix.include entries) and change the upload step to use ${{
matrix.platform_name }}; update only the Upload digest step and the new matrix
or compute step references accordingly.
| - name: Upload digest | ||
| uses: actions/upload-artifact@v4 | ||
| with: | ||
| name: digests-${{ replace(matrix.platform, '/', '-') }} | ||
| path: /tmp/digests/* | ||
| if-no-files-found: error | ||
| retention-days: 1 |
There was a problem hiding this comment.
replace() function doesn't exist in GitHub Actions expressions — workflow will fail.
GitHub Actions expressions don't support a replace() function. The available functions are: always, cancelled, contains, endsWith, failure, format, fromJSON, hashFiles, join, startsWith, success, toJSON.
🐛 Proposed fix using shell variable substitution
Add a step to compute the sanitized platform name, then reference it in the upload step:
- name: Export digest
run: |
mkdir -p /tmp/digests
digest="${{ steps.build.outputs.digest }}"
touch "/tmp/digests/${digest#sha256:}"
+
+ - name: Prepare platform name
+ id: platform
+ run: |
+ platform="${{ matrix.platform }}"
+ echo "name=${platform//\//-}" >> "$GITHUB_OUTPUT"
- name: Upload digest
uses: actions/upload-artifact@v4
with:
- name: digests-${{ replace(matrix.platform, '/', '-') }}
+ name: digests-${{ steps.platform.outputs.name }}
path: /tmp/digests/*
if-no-files-found: error
retention-days: 1Alternatively, since you only have two platforms, you could add platform_name to the matrix:
matrix:
include:
- os: ubuntu-latest
platform: linux/amd64
platform_name: linux-amd64
- os: ubuntu-24.04-arm
platform: linux/arm64
platform_name: linux-arm64Then use ${{ matrix.platform_name }} in the artifact name.
🧰 Tools
🪛 actionlint (1.7.11)
[error] 61-61: undefined function "replace". available functions are "always", "cancelled", "case", "contains", "endswith", "failure", "format", "fromjson", "hashfiles", "join", "startswith", "success", "tojson"
(expression)
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.
In @.github/workflows/docker-publish.yml around lines 58 - 64, The workflow
fails because GitHub Actions expressions don't have replace(), so change the
artifact name usage in the Upload digest step (the actions/upload-artifact@v4
step where name: digests-${{ replace(matrix.platform, '/', '-') }}) — either add
a small prior step that computes a sanitized platform variable via shell (e.g.,
export PLATFORM_NAME="${{ matrix.platform }}" with parameter substitution to
replace "/" with "-" and then reference that env var in the upload step), or add
a platform_name field to the matrix (e.g., matrix.include entries) and change
the upload step to use ${{ matrix.platform_name }}; update only the Upload
digest step and the new matrix or compute step references accordingly.
Summary by CodeRabbit