Skip to content

fix: clean up and harden GitHub Actions workflows#437

Merged
GenerQAQ merged 6 commits intodevfrom
fix/ci-workflow-cleanup
Mar 17, 2026
Merged

fix: clean up and harden GitHub Actions workflows#437
GenerQAQ merged 6 commits intodevfrom
fix/ci-workflow-cleanup

Conversation

@GenerQAQ
Copy link
Copy Markdown
Contributor

@GenerQAQ GenerQAQ commented Mar 17, 2026

Why we need this PR?

The workflow filenames documented in AGENTS.md don't match the actual files under .github/workflows/. Multiple workflows also have incorrect path filters, inconsistent Node.js/pnpm versions, missing version checks, and other issues that can cause CI triggers to be missed or release pipelines to behave inconsistently. Additionally, all 10 release workflows generate static changelog templates (just a title + install command) with no actual code changes listed between versions.

Describe your solution

Systematic fixes across all 27 workflow files and AGENTS.md:

  1. AGENTS.md table correction — Update Workflow column to match actual filenames
  2. Path filter fix — Add src/packages/sandbox-cloudflare/** to package-test-sandbox-cloudflare.yaml
  3. Remove workflow_dispatch — 10 release workflows now trigger only on tags
  4. Remove version comments — Strip # vX.Y.Z from all action SHA pins (SHA itself is the pin)
  5. Unify Node.js to 22 — Upgrade from 20 in 9 files
  6. Unify pnpm to 10 — Upgrade from 9 in docs-test.yaml
  7. Fix pnpm installationsecurity-reusable.yaml now uses pnpm/action-setup action instead of npm install -g pnpm
  8. Add --provenance to npm publish — 3 npm release workflows (OIDC trusted publishers auth)
  9. Fix cache keypackage-release-openclaw.yaml cache-dependency-path changed to package-lock.json
  10. Helm chart version checkpublish-chart.yaml now verifies tag matches Chart.yaml version before publishing
  11. Path-scoped changelog generation — New reusable script .github/scripts/generate-changelog.sh replaces static changelog templates in all release workflows. Scopes git log to each component's source directory and groups commits by conventional commit type (Features, Bug Fixes, Other).
  12. Helm chart GitHub Releasepublish-chart.yaml now creates a GitHub Release (was missing entirely)

Implementation Tasks

  • Update AGENTS.md workflow filename table
  • Fix package-test-sandbox-cloudflare.yaml path filters
  • Remove workflow_dispatch from all release workflows
  • Remove version comments from action SHA pins (27 files)
  • Unify Node.js version to 22 (9 files)
  • Unify pnpm version to 10 (docs-test.yaml)
  • Fix security-reusable.yaml pnpm installation method
  • Add --provenance to npm publish steps (OIDC trusted publishers)
  • Fix package-release-openclaw.yaml cache dependency path
  • Add version verification step to publish-chart.yaml
  • Create .github/scripts/generate-changelog.sh reusable changelog script
  • Replace inline changelog in _reusable-docker-release.yaml (add source_dir input)
  • Pass source_dir from api/core/ui-release.yaml callers
  • Replace inline changelog in cli-release.yaml, client-release-ts.yaml, client-release-py.yaml
  • Replace heredoc changelog in package-release-openclaw.yaml, package-release-sandbox-cloudflare.yaml, package-release-claude-code.yaml
  • Add GitHub Release step to publish-chart.yaml
  • Update AGENTS.md to document changelog script

Impact Areas

  • Documentation
  • Other: CI/CD workflows (all 27 workflow files)

Checklist

  • Open your pull request against the dev branch.
  • All tests pass in available continuous integration systems (e.g., GitHub Actions).
  • Tests are added or modified as needed to cover code changes.

🤖 Generated with Claude Code

- Fix AGENTS.md workflow filename table to match actual filenames
- Fix package-test-sandbox-cloudflare.yaml path filters (add src/packages/sandbox-cloudflare/**)
- Remove workflow_dispatch from all 10 release workflows (tag-only triggers)
- Remove version comments from action SHA pins across all 27 workflows
- Unify Node.js version to 22 (was 20 in 9 files)
- Unify pnpm version to 10 (was 9 in docs-test.yaml)
- Fix security-reusable.yaml: use pnpm/action-setup instead of npm install -g pnpm
- Add --provenance to npm publish steps (OIDC trusted publishers)
- Fix package-release-openclaw.yaml cache key (package.json → package-lock.json)
- Add version verification step to publish-chart.yaml

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GenerQAQ GenerQAQ requested a review from a team as a code owner March 17, 2026 08:15
GenerQAQ and others added 2 commits March 17, 2026 16:50
- Quote $GITHUB_OUTPUT and $GITHUB_ENV references (SC2086)
- Quote variable expansions in npm view commands (SC2086)
- Move ${{ github.ref }} to env var to avoid SC2193 false positive
- Use heredoc for changelog generation instead of repeated redirects (SC2129)
- Move ${{ secrets.GITHUB_TOKEN }} to env var in publish-chart.yaml
- Quote ${{ env.CHART_PATH }} and helm push arguments

All workflows now pass actionlint with zero warnings.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Replace static changelog templates across all 10 release workflows with
a reusable script that generates real changelogs from git history. The
script scopes commits to each component's source directory and groups
them by conventional commit type (feat/fix/other).

- Create .github/scripts/generate-changelog.sh
- Add source_dir input to reusable Docker release workflow
- Add GitHub Release step to publish-chart.yaml (was missing)
- Update AGENTS.md to document the changelog script

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GenerQAQ
Copy link
Copy Markdown
Contributor Author

Code review

Found 1 issue:

  1. generate-changelog.sh requires full git history, but all release workflows use shallow clones (default fetch-depth: 1). The script calls git tag -l on line 55 to find the previous tag, but with a shallow clone no prior tags are available. This means PREV_TAG will always be empty, and every release changelog will say "Initial release." instead of listing actual commits. All checkout steps that precede the changelog script need with: fetch-depth: 0 (or at minimum fetch-tags: true).

Affected workflows: _reusable-docker-release.yaml, cli-release.yaml, client-release-ts.yaml, client-release-py.yaml, package-release-openclaw.yaml, package-release-sandbox-cloudflare.yaml, package-release-claude-code.yaml, publish-chart.yaml.

Script (tag lookup that will fail on shallow clone):

# ---------------------------------------------------------------------------
PREV_TAG=$(git tag -l "${TAG_PREFIX}*" --sort=-v:refname \
| grep -v "^${CURRENT_TAG}$" \
| head -1) || true

Example checkout missing fetch-depth: 0:

- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

- name: Checkout
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd

🤖 Generated with Claude Code

- If this code review was useful, please react with 👍. Otherwise, react with 👎.

…eneration

generate-changelog.sh uses `git tag -l` and `git log` to build changelogs,
but all release workflows used shallow clones (default fetch-depth: 1), so
the script could never find previous tags and always output "Initial release."

Add `fetch-depth: 0` to the checkout step in the job that calls
generate-changelog.sh across all 8 release workflows. Update AGENTS.md to
document this requirement.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GenerQAQ
Copy link
Copy Markdown
Contributor Author

Fix: Add fetch-depth: 0 to release workflow checkouts

generate-changelog.sh relies on git tag -l and git log to build changelogs, but all release workflows were using shallow clones (fetch-depth: 1 by default). This meant the script could never find previous tags and always fell back to outputting "Initial release." instead of real commit history.

Changes:

  • Added fetch-depth: 0 to the actions/checkout step in the job that runs generate-changelog.sh across all 8 release workflows
  • Updated AGENTS.md to document this requirement so future workflow changes don't regress

GenerQAQ and others added 2 commits March 17, 2026 18:21
…lease workflows

- Strip leading whitespace from heredoc footer content to prevent
  markdown rendering issues in changelogs
- Replace VERSION_PLACEHOLDER + bash substitution with direct variable
  interpolation in openclaw and sandbox-cloudflare workflows
- Add missing blank line before ### Pull Requests in AGENTS.md

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
- Wrap grep -v in { ... || true; } to prevent pipefail exit on first
  release when only one tag exists
- Add fallback message when no path-scoped commits exist between tags
- Derive Helm chart version from GITHUB_REF instead of relying on
  ACONEXT_CHART_VERSION_TAG env var from previous step

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@GenerQAQ GenerQAQ merged commit 4736222 into dev Mar 17, 2026
25 checks passed
@GenerQAQ GenerQAQ deleted the fix/ci-workflow-cleanup branch March 17, 2026 10:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant