Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions .github/workflows/gallery_build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,13 @@ jobs:
run: |
latestVersion=$(git -c 'versionsort.suffix=-' \
ls-remote --exit-code --refs --sort='version:refname' --tags https://github.com/uptake/pkgnet 'v*.*.*' \
| tail --lines=1 \
| tail -n 1 \
| awk -F/ '{ print $3 }' \
| sed s/v//)
| sed 's/v//')
echo "Found $latestVersion"
echo "latestVersion=$latestVersion" >> "$GITHUB_OUTPUT"
- name: Update Version in local DESCRIPTION file
run: sed -i -E "s/Version:.+$/Version:\s$latestVersion/" $GITHUB_WORKSPACE/DESCRIPTION
run: sed -i '' -E "s/^Version:.+$/Version: ${{steps.latesttag.outputs.latestVersion}}/" $GITHUB_WORKSPACE/DESCRIPTION
- name: Git Checkout New Docs Branch
run: |
git checkout -b website_docs_update
Expand All @@ -51,5 +52,5 @@ jobs:
- name: Commit website doc changes (overwrite if existing)
run: |
git add DESCRIPTION docs/\*
git commit -m "Update gallery documentation to ${{steps.previoustag.outputs.tag}}" || echo "No changes to commit"
git push -f origin website_docs_update
git commit -m "Update gallery documentation to ${{steps.latesttag.outputs.latestVersion}}" || echo "No changes to commit"
git push -f origin website_docs_update
10 changes: 5 additions & 5 deletions CLAUDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -66,8 +66,8 @@ elsewhere are also accepted).
`.github/workflows/gallery_build.yml` runs on push to `main` and on manual dispatch. It bumps
`DESCRIPTION`'s version to the latest pkgnet tag, builds the gallery, uploads `docs/` as an
artifact, and force-pushes the result to a `website_docs_update` branch for review by PR — it never
commits to `main` directly. Two existing quirks to be aware of if you touch it: `latestVersion` is a
plain shell variable that is never written to `$GITHUB_OUTPUT`, so
`steps.latesttag.outputs.latestVersion` (and `steps.previoustag.outputs.tag` in the commit message)
resolve to empty, and the version-lookup step uses GNU `tail --lines=1`/`sed -i -E` while the job
runs on `macos-latest`.
commits to `main` directly. The version-lookup step writes `latestVersion` to `$GITHUB_OUTPUT`, and
every downstream reference (the DESCRIPTION rewrite, the artifact name, the commit message) reads
`steps.latesttag.outputs.latestVersion` — a plain shell variable would not survive across steps.
Because the job runs on `macos-latest`, the shell in that step must stay BSD-compatible: `tail -n 1`,
not `tail --lines=1`, and `sed -i '' -E`, not `sed -i -E`.