Skip to content

Add auto-release-check workflow#546

Draft
daogrady wants to merge 1 commit into
mainfrom
chore/auto-release-check
Draft

Add auto-release-check workflow#546
daogrady wants to merge 1 commit into
mainfrom
chore/auto-release-check

Conversation

@daogrady
Copy link
Copy Markdown
Contributor

@daogrady daogrady commented Apr 29, 2026

Add Auto Release Check Workflow

New Feature

✨ Introduces a new reusable GitHub Actions workflow (auto-release-check.yml) that periodically checks for unreleased changes and automatically triggers a release when needed.

Changes

  • .github/workflows/auto-release-check.yml: New workflow file that:
    • Runs on a daily schedule (2 AM UTC by default), supports workflow_dispatch for manual triggers, and can be called as a reusable workflow (workflow_call)
    • Accepts configurable inputs: cron-schedule, dry-run, and tag (latest or next)
    • check-unreleased-changes job: Fetches the full git history, finds the latest vX.Y.Z tag, counts commits since that tag, and outputs whether unreleased changes exist
    • trigger-release job: Conditionally calls .github/workflows/release.yml when unreleased commits are detected, passing through dry-run and tag inputs
    • summary job: Generates a GitHub Step Summary reporting the latest tag, unreleased commit count, and whether a release was triggered
  • 🔄 Regenerate and Update Summary
PR Bot Information

Version: 1.20.33

  • Summary Prompt: Default Prompt
  • Correlation ID: 4feb0cbd-0c50-4461-9088-82f3db8081a4
  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.opened
  • Output Template: Default Template

Copy link
Copy Markdown
Contributor

@hyperspace-insights hyperspace-insights Bot left a comment

Choose a reason for hiding this comment

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

The new workflow has several substantive issues that need to be resolved before it can work correctly: the most critical is that release.yml is not a callable workflow, which will cause a hard runtime failure; additionally, the unused cron-schedule input, unquoted shell variables, overly broad permissions, and the summary job's skipping behaviour all need to be addressed.

PR Bot Information

Version: 1.20.33

  • Correlation ID: 4feb0cbd-0c50-4461-9088-82f3db8081a4
  • File Content Strategy: Full file content
  • LLM: anthropic--claude-4.6-sonnet
  • Event Trigger: pull_request.opened

Comment on lines +8 to +12
cron-schedule:
description: Cron schedule for periodic checks (default is daily at 2 AM UTC)
required: false
type: string
default: '0 2 * * *'
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.

Bug: workflow_call trigger's cron-schedule input is defined but never used

The cron-schedule input is declared under workflow_call inputs (line 8–12) but is never referenced anywhere in the workflow. The hardcoded schedule trigger (line 23–25) always runs at 0 2 * * * and ignores this input entirely. GitHub Actions does not support dynamically changing the schedule cron from a workflow_call input — schedules are static and cannot be parameterised at call time.

The cron-schedule input should be removed to avoid misleading callers who might believe they can override the schedule through it.

Suggested change
cron-schedule:
description: Cron schedule for periodic checks (default is daily at 2 AM UTC)
required: false
type: string
default: '0 2 * * *'
dry-run:
description: Dry run mode for testing
required: false
type: boolean
default: false

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

echo "latest-tag=$latest_tag" >> $GITHUB_OUTPUT

# Count commits since the latest tag
commits_count=$(git rev-list ${latest_tag}..HEAD --count)
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.

Bug: Unquoted variable ${latest_tag} in git rev-list is vulnerable to tag names with special characters

If latest_tag ever contains spaces or shell-special characters, the command will break or behave unexpectedly. The variable should be double-quoted.

Same issue also applies to line 84 (git log ${latest_tag}..HEAD --oneline).

Suggested change
commits_count=$(git rev-list ${latest_tag}..HEAD --count)
commits_count=$(git rev-list "${latest_tag}..HEAD" --count)

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful


# Show the commits for logging
echo "Unreleased commits:"
git log ${latest_tag}..HEAD --oneline
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.

Bug: Unquoted variable ${latest_tag} in git log is vulnerable to word splitting / glob expansion

The variable should be double-quoted, consistent with the fix suggested for line 73.

Suggested change
git log ${latest_tag}..HEAD --oneline
git log "${latest_tag}..HEAD" --oneline

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

trigger-release:
needs: check-unreleased-changes
if: ${{ needs.check-unreleased-changes.outputs.has-unreleased-changes == 'true' }}
uses: ./.github/workflows/release.yml
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.

Logic Error: trigger-release job references release.yml via a relative path, but release.yml is not a reusable workflow

release.yml is triggered by push to main and workflow_dispatch; it does not declare an on: workflow_call trigger. Calling it with uses: ./.github/workflows/release.yml will therefore fail at runtime with an error like "workflow is not callable".

The referenced workflow must expose a workflow_call event before it can be used here. Either add workflow_call to release.yml, or call the underlying reusable workflow (cap-js/.github/.github/workflows/release.yml@main) directly from this job.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

Comment on lines +39 to +41
permissions:
contents: write
id-token: write
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.

Security: Workflow-level contents: write and id-token: write permissions are broader than necessary

The check-unreleased-changes job only reads git history and requires no elevated permissions. Granting contents: write and id-token: write at the top level gives every job—including the read-only check-unreleased-changes and summary jobs—those permissions.

Consider scoping permissions per-job: give contents: read (and no id-token) to check-unreleased-changes and summary, and only grant the elevated permissions to trigger-release (or inherit them from the called workflow).

Suggested change
permissions:
contents: write
id-token: write
permissions:
contents: read

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful


summary:
runs-on: ubuntu-latest
needs: [check-unreleased-changes, trigger-release]
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.

Logic Error: summary job will be skipped whenever trigger-release is skipped

needs: [check-unreleased-changes, trigger-release] causes GitHub Actions to mark the summary job as skipped when trigger-release is skipped (i.e. when there are no unreleased changes), even though if: always() is set. The always() condition overrides failure/cancellation but not skipping induced by a skipped dependency.

To always run the summary regardless of whether trigger-release ran, remove trigger-release from the needs list and read its result via needs.trigger-release.result only when needed (it will be 'skipped' rather than causing the job itself to be skipped).

Suggested change
needs: [check-unreleased-changes, trigger-release]
needs: [check-unreleased-changes, trigger-release]
if: ${{ always() }}

Double-check suggestion before committing. Edit this comment for amendments.


Please provide feedback on the review comment by checking the appropriate box:

  • 🌟 Awesome comment, a human might have missed that.
  • ✅ Helpful comment
  • 🤷 Neutral
  • ❌ This comment is not helpful

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