Skip to content

ci(release): gate releases on vendor/ sync, add automated bump-version PR flow - #216

Open
felickz wants to merge 1 commit into
mainfrom
felickz-laughing-meme
Open

ci(release): gate releases on vendor/ sync, add automated bump-version PR flow#216
felickz wants to merge 1 commit into
mainfrom
felickz-laughing-meme

Conversation

@felickz

@felickz felickz commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Why

While debugging why a manual-release run didn't bump .release.yml/README.md, found two gaps:

  1. No automation ever bumped .release.yml. manual-release (workflow_dispatch) tags/publishes a GitHub Release computed from the latest GitHub Release tag, entirely bypassing .release.yml. Nothing wrote back to .release.yml, README.md, or ghascompliance/__version__.py — the only way was a hand edit. advanced-security/spdx-dependency-submission-action's release.yml already solved this with a patch-release-me-based bump job; this PR ports that pattern here.
  2. Releases weren't guarded against a stale vendor/. action.yml runs the action directly out of the committed vendor/ tree (PYTHONPATH includes vendor/), so vendor/ is the shipped runtime artifact. If Pipfile.lock moved on main but the vendor-sync PR hasn't merged yet, a release cut in that window would ship mismatched dependencies with nothing catching it.

What changed

  • check-vendor-sync (new job): regenerates vendor/ from Pipfile.lock and fails the run if that produces a diff, before auto-release/manual-release can publish.
  • bump-version (new job, workflow_dispatch with bump: patch/minor/major): opens a PR bumping .release.yml and every location it tracks, via 42ByteLabs/patch-release-me. Invoked directly via docker run rather than the wrapping action — that action's own Docker CMD construction mis-splits -m "minor"/-m "major" into a single argv token, so clap can't parse it and silently falls back to a patch bump (see patch-release-me#161, fix unmerged in #162). reusable-workflows' own self-release.yml still uses the buggy form, so it wasn't safe to copy either.
  • manual-release now only fires for an explicit version input (the ad hoc/pre-release path). bump no longer cuts a release immediately — it opens a PR instead, and merging that PR (which touches .release.yml) is what triggers auto-release.
  • .release.yml now tracks ghascompliance/__version__.py as a bump location — it was never kept in sync before.
  • Reconciled .release.yml/README.md/docs/introduction/actions.md/ghascompliance/__version__.py from the stale 2.11.1 to the actual latest published release, 2.12.1 (drift caused by earlier ad hoc manual-release test runs during this investigation), so the next bump-version PR computes correctly instead of walking versions backward.

Follow-up flow going forward

  1. Run Release workflow with bump: patch|minor|major → opens a PR bumping .release.yml + tracked files.
  2. Merge that PR → auto-release fires automatically (after check-vendor-sync passes) → tags + publishes the GitHub Release.
  3. version input remains for ad hoc/hotfix/pre-release cuts that intentionally bypass .release.yml.

Testing

  • Validated both .release.yml and .github/workflows/release.yml parse as YAML.
  • Manually traced the patch-release-me bug and confirmed via spdx-dependency-submission-action's workflow and reusable-workflows' self-release.yml source.
  • Not able to dry-run bump-version/check-vendor-sync locally (they need docker/pipenv in Actions); recommend a maintainer runs bump-version with bump: patch once merged to validate end-to-end before relying on it.

…n PR flow

Two gaps found while investigating why a manual-release run didn't bump
.release.yml/README:

- manual-release (workflow_dispatch) tags/publishes off the latest GitHub
  Release, entirely bypassing .release.yml - there was no automation that
  ever bumped .release.yml/README.md/ghascompliance/__version__.py.
- action.yml runs directly out of the committed vendor/ tree at runtime, so
  a release cut while vendor/ is out of sync with Pipfile.lock (e.g. a
  pending vendor-sync PR) would ship stale dependencies.

Changes:
- Add check-vendor-sync job: regenerates vendor/ and fails auto-release /
  manual-release if it produces a diff against Pipfile.lock.
- Add bump-version job (workflow_dispatch, bump: patch/minor/major): opens
  a PR bumping .release.yml and every location it tracks via
  42ByteLabs/patch-release-me, invoked directly via docker run to avoid a
  known arg-splitting bug in the wrapping action (upstream #161/#162) that
  silently downgrades minor/major bumps to patch. Modeled on
  advanced-security/spdx-dependency-submission-action's release.yml.
- manual-release now only fires for an explicit "version" input (ad hoc /
  pre-release path); bump no longer releases immediately.
- Track ghascompliance/__version__.py as a bump location in .release.yml -
  it was never kept in sync before.
- Reconcile .release.yml/README.md/docs/ghascompliance/__version__.py from
  the stale 2.11.1 to the actual latest published release, 2.12.1.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: c448d197-00e8-49b3-9ce6-48b9088db0d0
@felickz
felickz requested a review from a team as a code owner August 24, 2026 16:10
@felickz
felickz requested review from adrienpessu and a lite review from Copilot August 24, 2026 16:10
@github-actions

Copy link
Copy Markdown
Contributor

Dependency Review

The following issues were found:
  • ✅ 0 vulnerable package(s)
  • ✅ 0 package(s) with incompatible licenses
  • ✅ 0 package(s) with invalid SPDX license definitions
  • ⚠️ 2 package(s) with unknown licenses.
See the Details below.

License Issues

.github/workflows/release.yml

PackageVersionLicenseIssue Type
actions/checkout7.*.*NullUnknown License
actions/setup-python7.*.*NullUnknown License

OpenSSF Scorecard

PackageVersionScoreDetails
actions/actions/checkout 7.*.* 🟢 7
Details
CheckScoreReason
Maintained🟢 1024 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Code-Review🟢 10all changesets reviewed
Binary-Artifacts🟢 10no binaries found in the repo
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Fuzzing⚠️ 0project is not fuzzed
Packaging⚠️ -1packaging workflow not detected
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Pinned-Dependencies🟢 3dependency not pinned by hash detected -- score normalized to 3
Security-Policy🟢 9security policy file detected
SAST🟢 10SAST tool is run on all commits
Branch-Protection🟢 6branch protection is not maximal on development and all release branches
actions/actions/setup-python 7.*.* 🟢 6.6
Details
CheckScoreReason
Code-Review🟢 10all changesets reviewed
Maintained🟢 1018 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 10
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Packaging⚠️ -1packaging workflow not detected
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
Pinned-Dependencies🟢 7dependency not pinned by hash detected -- score normalized to 7
Signed-Releases⚠️ -1no releases found
Security-Policy🟢 9security policy file detected
SAST🟢 9SAST tool is not run on all commits -- score normalized to 9
Branch-Protection⚠️ 0branch protection not enabled on development/release branches
actions/peter-evans/create-pull-request 5f6978faf089d4d20b00c7766989d076bb2fc7f1 🟢 5.1
Details
CheckScoreReason
Code-Review⚠️ 2Found 2/8 approved changesets -- score normalized to 2
Binary-Artifacts🟢 10no binaries found in the repo
Dangerous-Workflow🟢 10no dangerous workflow patterns detected
Maintained🟢 911 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 9
Packaging⚠️ -1packaging workflow not detected
Token-Permissions⚠️ 0detected GitHub workflow tokens with excessive permissions
CII-Best-Practices⚠️ 0no effort to earn an OpenSSF best practices badge detected
Pinned-Dependencies🟢 10all dependencies are pinned
Fuzzing⚠️ 0project is not fuzzed
License🟢 10license file detected
Signed-Releases⚠️ -1no releases found
Security-Policy⚠️ 0security policy file not detected
Branch-Protection⚠️ -1internal error: error during branchesHandler.setup: internal error: some github tokens can't read classic branch protection rules: https://github.com/ossf/scorecard-action/blob/main/docs/authentication/fine-grained-auth-token.md
SAST⚠️ 0SAST tool is not run on all commits -- score normalized to 0

Scanned Files

  • .github/workflows/release.yml

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refactors the repository’s release automation to (1) make version bumps happen via an automated PR that updates all tracked version locations and (2) gate publishing releases on vendor/ being regenerated cleanly from Pipfile.lock, aligning the release artifact with the repo’s shipped runtime dependencies.

Changes:

  • Add a bump-version workflow_dispatch path that runs patch-release-me via docker run and opens a PR bumping .release.yml + tracked locations.
  • Add a check-vendor-sync job and make publishing jobs depend on it, failing the release if regenerating vendor/ produces a diff.
  • Reconcile version references to 2.12.1 across .release.yml, docs, README, and ghascompliance/__version__.py, and update .release.yml to track ghascompliance/__version__.py.
Show a summary per file
File Description
.github/workflows/release.yml Adds bump-version PR automation and gates publishing paths on a vendor-sync verification job.
.release.yml Updates tracked version to 2.12.1 and adds ghascompliance/__version__.py as a bump target.
ghascompliance/__version__.py Updates the library version constant to 2.12.1.
README.md Updates example action refs / clone commands to v2.12.1.
docs/introduction/actions.md Updates example action refs to v2.12.1.

Review details

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 5/5 changed files
  • Comments generated: 1
  • Review effort level: Lite

Comment on lines +128 to +131
if: >-
github.repository == 'advanced-security/policy-as-code' &&
(github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && inputs.version != ''))
runs-on: ubuntu-latest
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.

2 participants