ci: scope release env and OIDC permissions to master#1799
Merged
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1799 +/- ##
=======================================
Coverage 99.77% 99.77%
=======================================
Files 33 33
Lines 3540 3540
Branches 498 498
=======================================
Hits 3532 3532
Misses 5 5
Partials 3 3 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
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.
Summary
The single
releasejob heldid-token: write,contents: write, and thereleaseenvironment on every trigger including pull requests, even though it only published on master; this splits it into two jobs so PR runs no longer carry release credentials.Details
release-dry-runruns on PRs and non-master pushes with onlycontents: read, no environment and no OIDC, just the python-semantic-release dry run.releaseruns only on master and keeps thereleaseenvironment,id-token: writeandcontents: writescoped to that job, so the privileges never apply to untrusted PR code.git switchnow reads the ref from an env var instead of interpolating it straight into the run script.Same split already adopted in pySwitchbot and nexia; resolves the dbus-fast issue tracked at Bluetooth-Devices/dbus-fast#769, which also affects this repo.
Test plan
yaml.safe_load)