{{ message }}
fix: split release-drafter into dedicated reusable workflows for drafting and PR labeling#71
Merged
Merged
Conversation
…se drafting and PR labeling Co-authored-by: 2bndy5 <14963867+2bndy5@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix write permission issue in release-drafter
fix: split release-drafter into dedicated reusable workflows for drafting and PR labeling
Mar 16, 2026
Contributor
|
@copilot Please append a
We should address this separately (in a new issue). It will require creating (duplicate) environments in the cpp-linter org repos that call these reusable workflows (with |
Co-authored-by: 2bndy5 <14963867+2bndy5@users.noreply.github.com>
Contributor
Author
2bndy5
approved these changes
Mar 16, 2026
2bndy5
left a comment
Contributor
There was a problem hiding this comment.
@copilot Find other cpp-linter org repos that call cpp-linter/.github/.github/workflows/release-drafter.yml and up date them appropriately; use cpp-linter/.github/.github/workflows/pr-labeler.yml for workflows that adjust labels on PR events. And don't forget to ensure permissions are set as required by this PR's changes.
2bndy5
added a commit
to cpp-linter/cpp-linter-action
that referenced
this pull request
Mar 17, 2026
- [x] remove unused config - [x] update permissions for jobs that invoke reusable release-drafter workflows - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74
3 tasks
2bndy5
added a commit
to cpp-linter/cpp-linter-hooks
that referenced
this pull request
Mar 17, 2026
- [x] switch to cpp-linter org's release-drafter config - [x] update permissions for jobs that invoke release-drafter workflows (reusable and local) - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74
3 tasks
2bndy5
added a commit
to cpp-linter/cpp-linter
that referenced
this pull request
Mar 17, 2026
- [x] remove unused release-drafter config - [x] update permissions for jobs that invoke reusable release-drafter workflows - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74
3 tasks
2bndy5
added a commit
to cpp-linter/clang-tools-pip
that referenced
this pull request
Mar 17, 2026
- [x] remove unused release-drafter config - [x] update permissions for jobs that invoke reusable release-drafter workflows - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74 - supersedes and closes #151
3 tasks
2bndy5
added a commit
to cpp-linter/clang-tools-docker
that referenced
this pull request
Mar 17, 2026
- [x] switch to cpp-linter org's release-drafter config - [x] update permissions for jobs that invoke release-drafter workflows (reusable and local) - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74
3 tasks
2bndy5
added a commit
to cpp-linter/cpp-linter-hooks
that referenced
this pull request
Mar 17, 2026
- [x] switch to cpp-linter org's release-drafter config - [x] update permissions for jobs that invoke release-drafter workflows (reusable and local) - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74
2bndy5
added a commit
to cpp-linter/cpp-linter-action
that referenced
this pull request
Mar 17, 2026
- [x] remove unused release-drafter config - [x] update permissions for jobs that invoke reusable release-drafter workflows - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74
2bndy5
added a commit
to cpp-linter/clang-tools-pip
that referenced
this pull request
Mar 17, 2026
- [x] remove unused release-drafter config - [x] update permissions for jobs that invoke reusable release-drafter workflows - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74 - supersedes and closes #151
2bndy5
added a commit
to cpp-linter/cpp-linter
that referenced
this pull request
Mar 17, 2026
- [x] remove unused release-drafter config - [x] update permissions for jobs that invoke reusable release-drafter workflows - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74
2bndy5
added a commit
to cpp-linter/cpp-linter
that referenced
this pull request
Mar 17, 2026
- [x] remove unused release-drafter config - [x] update permissions for jobs that invoke reusable release-drafter workflows - [x] switch labeler workflow to use separate reusable workflow refs: - cpp-linter/.github#71 - cpp-linter/.github#74
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.

.github/workflows/release-drafter.ymlto release-drafter v7 (pinned SHA), set permissions{contents: write, pull-requests: read}.github/workflows/pr-labeler.ymlusingrelease-drafter/release-drafter/autolabelerv7 (pinned SHA), set permissions{pull-requests: write, contents: read}# zizmor: ignore[secrets-outside-env]to suppress zizmor audit warnings (to be resolved properly in a follow-up issue with org-level environments)Original prompt
This section details on the original issue you should resolve
<issue_title>write permission is conditionally needed by release-drafter</issue_title>
<issue_description>The cpp-linter repo has 2 workflows that call into the reusable workflow,
.github/workflows/release-drafter.yml:While the reusable workflow demands write permission regardless of calling context:
.github/.github/workflows/release-drafter.yml
Lines 15 to 19 in 86b6518
Proposal
The
permissionsmap cannot be dynamically set.This means we need 2 separate reusable workflows for each calling context:
Because the reusable workflow is just 1 step, I'm inclined to just copy that 1 step into the calling workflows' yml and modify the permissions as needed.
Or use git-cliff + gh-cli
In the cpp-linter-rs repo, I use a script (written in python) to
inputs.component. In rust this requires altering the Cargo.toml manifest. In python we would only need to calculate the version based on the last tag.gitto push any metadata file changes. The step is not required wheresetuptools-scmautomatically sets the package version based ongit describe --tags(or similar).permissions: {contents: write}) to publish a release, which inherently creates a new tag that triggers build/deploy CI workflows.This might seem overly complicated, but it provides much better flexibility and does not surrender security to third-party software that we don't control/understand.
</issue_description>
<agent_instructions>see #47 (comment)</agent_instructions>
Comments on the Issue (you are @copilot in this section)
@shenxianpeng @shenxianpeng I'm giving serious thought about revising the release process here. The release-drafter project is not as well maintained as it once was (see release-drafter/release-drafter#1455). Given the complexity of the supported config, it is not surprising that maintenance has been lacking attention.Auto label doesn't work
I think we need to use a separate config just for that auto-label feature (during a PR event).
And, for some reason, the release-drafter action tries to create/update a drafted release during a PR event, before it is merged (?!).
There must be a better way to auto label PR. Personally, I could do it with nushell and gh-cli...
Drafting releases
If releases are only focused on PRs, then commits pushed directly to main will not show up in the release notes 👎🏼.
I understand that release-drafter relies solely on PR/issue labels to categorize release notes. But release notes can be generated in a number of different ways.
I know git-cliff can use both PR labels and conventional-commit titles to categorize changes. Git-cliff can even "guess" the next version tag based on unreleased changes, but I don't often use that feature.
Originally posted by @2bndy5 in cpp-linter/cpp-linter#154 (comment)
@2bndy5 > Or use [git-cliff](https://git-cliff.org/) + [gh-cli](https://cli.github.com/)I'm literally putting this together right now. I'm writing it in a way that should be applicable to any cpp-linter repos (as a reusable workflow)... But I want to test it first in cpp-linter because we already have a pending release.
I agree that the label does not work well. maybe we could try to use [Continuous AI](ht...
📍 Connect Copilot coding agent with Jira, Azure Boards or Linear to delegate work to Copilot in one click without leaving your project management tool.