Skip to content

ci: allow the release workflow to be triggered manually - #932

Open
robdecker wants to merge 2 commits into
mainfrom
ci/release-workflow-dispatch
Open

robdecker wants to merge 2 commits into
mainfrom
ci/release-workflow-dispatch

Conversation

@robdecker

@robdecker robdecker commented Sep 22, 2026

Copy link
Copy Markdown
Member

This pull request is for: (mark with an "x")

  • examples/*
  • modules/next
  • packages/next-drupal
  • starters/basic-starter
  • starters/graphql-starter
  • starters/pages-starter
  • Other

GitHub Issue: n/a

  • I need help adding tests. (mark with an "x")

Describe your changes

Adds workflow_dispatch to release.yml so it can be started by hand, and restricts the workflow to main so that trigger cannot be abused.

Why the manual trigger

The first run of the release workflow failed at startup. This repository allows only a few actions to run, and the workflow introduced two that were not on the list, so the run was rejected before any step executed. The allowlist has since been corrected.

The problem is retrying. A run that fails at startup cannot be re-run:

run 35774830123 cannot be rerun; This workflow run cannot be retried

And the workflow's only trigger was a push to main, which takes no direct pushes. So the sole way to retry was to merge another pull request purely to generate a push, which is what this one is. workflow_dispatch means that is not needed a second time.

Why the ref check

workflow_dispatch on its own would have been a regression, so it does not ship alone.

A manual run lets whoever starts it choose the branch. Both the workflow definition and the code actions/checkout fetches then come from that branch, and npm's trusted publisher matches on repository and workflow filename, not on ref. So anyone with write access could push a branch carrying a modified release.yml, dispatch it, and publish arbitrary code to the latest tag without review.

That defeats the reason main requires a reviewed pull request. Both jobs are now gated on github.ref == 'refs/heads/main', which keeps the manual trigger useful for retrying a run from main and closes the arbitrary-branch path.

The check is repeated on the publish job rather than inherited. Skipping release-please already skips it, because its output would be empty, but the job that holds id-token: write and can publish should not depend on another job's condition to stay on main.

What this does not change

Releases still originate from a merged release pull request. The dispatch trigger reruns the workflow; it does not create a release on its own, because publish still requires releases_created.

Merging this produces the push that runs the release workflow, so it should also open the 2.1.0 release pull request.

  • Was AI used in this pull request?

The first release run failed at startup, because the repository allows only
four actions to run and the workflow introduced two more. A run that fails at
startup cannot be re-run, and `main` takes no direct pushes, so the only way to
retry was to merge another pull request purely to produce a push.

Add `workflow_dispatch` so the workflow can be started from the Actions tab
once whatever blocked it is fixed.
@vercel

vercel Bot commented Sep 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
next-drupal-next Ready Ready Preview Sep 22, 2026 7:49pm UTC
2 Skipped Deployments
Project Deployment Actions Updated
next-drupal Ignored Ignored Sep 22, 2026 7:49pm UTC
next-drupal-v1-6 Ignored Ignored Sep 22, 2026 7:49pm UTC

Request Review

Adding `workflow_dispatch` in the previous commit opened a path it should not
have. A manual run lets whoever starts it choose the branch, and both the
workflow definition and the checked-out code then come from that branch, while
npm's trusted publisher matches on repository and workflow filename rather than
on ref. So anyone with write access could push a branch, dispatch it, and
publish to the `latest` tag without review.

That is a regression against the reason `main` requires a reviewed pull request
in the first place. Gate both jobs on `github.ref == 'refs/heads/main'`, which
leaves the manual trigger useful for retrying a run from `main` and closes the
arbitrary-branch path.

The check is repeated on the publish job rather than inherited: skipping
release-please already skips it, but the job that holds `id-token` and can
publish should not rely on another job's condition to stay on `main`.

This branch was successfully deployed

1 active deployment
Preview – next-drupal-next e2aa9170 Deployed Sep 22, 2026 by vercel[bot]
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