Repository navigation
Review: Improve composability (upstream #269) #1
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
base: base/pr-269
Are you sure you want to change the base?
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 |
|---|---|---|
|
|
@@ -48,24 +48,44 @@ runs: | |
| LINUX_X64_SHA: "$PKG_LINUX_X64_SHA" | ||
| run: | | ||
| "$$GITHUB_ACTION_PATH/scripts/verify.sh" | ||
| - name: Prepare checkout | ||
| shell: sh | ||
| run: | | ||
| mkdir .tmp-anttiharju-compare-changes # no -p on purpose: why would you have directory with this name in your repository? | ||
| printf '*\n' > .tmp-anttiharju-compare-changes/.gitignore | ||
| - if: github.event_name == 'pull_request' || github.event_name == 'merge_group' | ||
| name: Checkout | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| path: .tmp-anttiharju-compare-changes/${{ github.repository }} | ||
| fetch-depth: 2 | ||
| persist-credentials: true | ||
| - if: github.event_name == 'push' | ||
| name: Checkout | ||
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | ||
| with: | ||
| path: .tmp-anttiharju-compare-changes/${{ github.repository }} | ||
| persist-credentials: true | ||
| - name: Run | ||
| id: run | ||
| working-directory: .tmp-anttiharju-compare-changes/${{ github.repository }} | ||
| shell: sh | ||
| env: | ||
| BINARY: ${{ steps.check.outputs.directory }}/compare-changes | ||
| run: | | ||
| "$$BINARY" --find | ||
| - if: always() | ||
| name: Clean up checkout | ||
| shell: sh | ||
| run: | | ||
| directory=".tmp-anttiharju-compare-changes/$$GITHUB_REPOSITORY" | ||
| if [ -f "$$directory/.git/config" ]; then | ||
| credentials="$$(git config --file "$$directory/.git/config" --get "includeIf.gitdir:$$PWD/$$directory/.git.path" || true)" | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Credential cleanup may silently no-op
🤖 Prompt for AI Agents |
||
| case "$$credentials" in | ||
| "$$RUNNER_TEMP"/git-credentials-*.config) rm -f "$$credentials" ;; | ||
| esac | ||
| fi | ||
| rm -rf .tmp-anttiharju-compare-changes | ||
| outputs: | ||
| array: | ||
| description: "JSON array of changed files." | ||
|
|
||
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.
fetch-tags on a shallow checkout may not bring the tag render.sh needs
fetch-tags: trueThis replaces the explicit
git fetch origin 'refs/tags/*:refs/tags/*'workaround for anttiharju#258. The checkout here is shallow (nofetch-depth, so depth 1), andactions/checkout'sfetch-tagsonly lifts git's default tag-following (--no-tagsis dropped, but the tags refspec is only added forfetch-depth: 0), i.e. it can fetch tags that point at the fetched commit rather than all tag refs. If the latest tag points at an older main commit (the normal case for a push-to-main run),render.sh(tag="$(git tag --sort=-creatordate | head -n1)") sees no tags,values.shbails out withTAG=v0.0.0and emitsTBDchecksums, so the rendered action /Test action (release binary)step is wrong or fails. Confirm this on a real run (or setfetch-depth: 0, or keep the explicit tag fetch) before relying on it.🤖 Prompt for AI Agents