Skip to content

Use workflow_dispatch ref instead of manual inputs#15369

Merged
jamesfredley merged 1 commit into7.0.xfrom
ci/publish-docs-workflow
Feb 1, 2026
Merged

Use workflow_dispatch ref instead of manual inputs#15369
jamesfredley merged 1 commit into7.0.xfrom
ci/publish-docs-workflow

Conversation

@jamesfredley
Copy link
Copy Markdown
Contributor

No description provided.

Copilot AI review requested due to automatic review settings February 1, 2026 02:36
@jamesfredley jamesfredley merged commit 6420033 into 7.0.x Feb 1, 2026
29 checks passed
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Updates the manual documentation publishing workflow to derive the release/tag information from the workflow_dispatch run ref instead of requiring users to provide tag and target_branch inputs.

Changes:

  • Removes workflow_dispatch inputs (tag, target_branch) and related env vars.
  • Introduces REF derived from github.ref_name and uses it to compute VERSION.
  • Uses the dispatch ref for actions/checkout and passes REF into -PgithubBranch.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

steps:
- name: "📝 Establish release version"
run: echo "VERSION=${TAG#v}" >> "$GITHUB_ENV"
run: echo "VERSION=${REF#v}" >> "$GITHUB_ENV"
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

VERSION=${REF#v} assumes the workflow is dispatched from a v* tag; if the workflow is run from a branch (the workflow_dispatch UI allows this), VERSION will be wrong (e.g., main) and the job may publish docs under an unintended version. Add an explicit guard that fails early unless github.ref is a tag (and optionally matches refs/tags/v*).

Suggested change
run: echo "VERSION=${REF#v}" >> "$GITHUB_ENV"
run: |
if [[ "${GITHUB_REF}" != refs/tags/v* ]]; then
echo "Error: This workflow must be run from a v* tag. Current ref: ${GITHUB_REF}" >&2
exit 1
fi
echo "VERSION=${REF#v}" >> "$GITHUB_ENV"

Copilot uses AI. Check for mistakes.
Comment on lines 62 to +63
- name: "📖 Generate Documentation"
run: ./gradlew grails-doc:build -PgithubBranch=${TARGET_BRANCH}
run: ./gradlew grails-doc:build -PgithubBranch=${REF}
Copy link

Copilot AI Feb 1, 2026

Choose a reason for hiding this comment

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

-PgithubBranch=${REF} changes semantics from the previous TARGET_BRANCH input. In grails-doc/build.gradle, githubBranch is used to form GitHub edit URLs (e.g., https://github.com/apache/grails-core/edit/$githubBranch/...), and passing a tag ref name will produce edit links pointing at a tag (often read-only / not the intended maintenance branch). Consider restoring a separate target-branch value (input or derived from the tag, e.g., 7.0.x) and keep REF/tag only for checkout/versioning.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants