Skip to content

ci: Restore changelog-preview workflow with hardened craft 2.26.2#6056

Open
antonis wants to merge 2 commits intomainfrom
ci/restore-changelog-preview-hardened
Open

ci: Restore changelog-preview workflow with hardened craft 2.26.2#6056
antonis wants to merge 2 commits intomainfrom
ci/restore-changelog-preview-hardened

Conversation

@antonis
Copy link
Copy Markdown
Contributor

@antonis antonis commented Apr 27, 2026

📢 Type of change

  • Bugfix
  • New feature
  • Enhancement
  • Refactoring

📜 Description

Re-adds .github/workflows/changelog-preview.yml, removed in #6030, using the hardened reusable workflow from getsentry/craft@v2.26.2 (#6050).

Differences from the previously deleted file:

  • Pinned to craft 3dc647fee3586e57c7c31eb900fdec7cbb44f23f (v2.26.2) instead of v2.25.4.
  • permissions.contents: writecontents: read. Upstream's reusable workflow only reads git metadata + .craft.yml; write was unnecessary and unsafe under pull_request_target.
  • Drop statuses: write (only needed in non-comment / status-check mode; we use the default comment mode).
  • Add unlabeled to the trigger types per upstream's recommended caller template.

💡 Motivation and Context

The original workflow combined pull_request_target + contents: write + secrets: inherit while pinning to a craft version (v2.25.4) that predated the upstream hardening series (2.25.5 onward). PR #6030 removed it. Now that #6050 has landed bumping the release workflow to craft 2.26.2, we can safely restore the changelog preview using the redesigned upstream reusable workflow, which:

  • downloads the craft binary from releases (does not run any PR code),
  • reads only git metadata and .craft.yml,
  • checks out with persist-credentials: false.

Refs:

💚 How did you test it?

Workflow file only — will be exercised by GitHub once this PR is opened (the workflow runs on pull_request_target, so the version on the base branch is what executes; full validation will come once merged).

📝 Checklist

  • I added tests to verify changes
  • No new PII added or SDK only sends newly added PII if sendDefaultPII is enabled
  • I updated the docs if needed.
  • I updated the wizard if needed.
  • All tests passing
  • No breaking changes

🔮 Next steps

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 27, 2026

Fails
🚫 Pull request is not ready for merge, please add the "ready-to-merge" label to the pull request

Generated by 🚫 dangerJS against 91bdc07

@antonis antonis marked this pull request as ready for review April 27, 2026 14:51
Copy link
Copy Markdown

@cursor cursor Bot left a comment

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 143787a. Configure here.

Comment thread .github/workflows/changelog-preview.yml Outdated
The reusable workflow only references secrets.GITHUB_TOKEN, which is
auto-provisioned per job. Inheriting all repo secrets under
pull_request_target is unnecessary exposure.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown
Collaborator

@lucas-zimerman lucas-zimerman left a comment

Choose a reason for hiding this comment

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

LGTM!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants