Repository navigation
workflow_run "Use the data" example omits the permissions the example itself needs #45520
Description
Code of Conduct
- I have read and agree to the GitHub Docs project's Code of Conduct
What article on docs.github.com is affected?
The Use the data example in the workflow_run section.
What part(s) of the article would you like to see updated?
The example has no permissions: block, and both of its steps need a permission that the restricted default does not grant.
The workflow downloads an artifact from a different workflow run, passing run-id and secrets.GITHUB_TOKEN, and then calls github.rest.issues.createComment. Your own reference pages say what those two calls require. Downloading an artifact is documented as needing Actions: read, and creating an issue comment is documented as accepting Issues: write or Pull requests: write. The restricted repository default grants read access to contents and packages only, and the workflow permissions reference says the effective token starts from that default and changes only through a permissions: key.
So a reader who copies this example into a repository on the restricted default gets a workflow that cannot download the artifact and cannot post the comment. On a permissive default the same example works, which is why the gap is easy to miss.
Adding the block to the example would fix it:
permissions:
actions: read
issues: writepull-requests: write is the documented alternative to issues: write here, not a third permission.
This matters more than a typo because the surrounding section is about handling a potentially untrusted triggering workflow, and the example already carries a security comment about not extracting into the workspace directory. An example in that context is the one readers are most likely to copy verbatim, and least likely to widen by hand.
Additional information
I read the source on main today, 17 August 2026, at content/actions/reference/workflows-and-actions/events-that-trigger-workflows.md. The example there has no permissions: key.
I checked six permission combinations against the two documented requirements. The current example fails on a restricted default and passes on a permissive one. The example with actions: read and issues: write passes on a restricted default. Either permission alone fails. The pull-requests: write variant passes. This is a reading of your documented requirements and not a live Actions run, so I am not reporting an observed error message.
I searched open and closed issues first. There are reports about GITHUB_TOKEN permissions in general, but none about this example.
The pages I read for the requirements:
- How permissions are calculated for a workflow job
- Setting GITHUB_TOKEN permissions for a repository
- Download an artifact
- Create an issue comment
The GitHub Security Lab article on preventing pwn requests uses the same two-workflow pattern and declares actions: read and pull-requests: write explicitly, which is the shape I am suggesting here.
Three things would make this report wrong, and I would rather name them than have you find them. If a workflow_run job is guaranteed Actions: read and Issues: write regardless of a restricted effective default, there is nothing to fix. If the cross-run download path in this exact example does not need Actions: read when given GITHUB_TOKEN, drop that line from the suggestion. And if the restricted default grants more than contents and packages in the relevant product context, the portability argument goes away.
Activity
subatoi commentedon Aug 17, 2026
Hello and thanks for reporting this as an issue, @erekola —let me attach an SME label to this. Unfortunately I can't guarantee a timeframe for a response, but I'll make sure it gets to the right team 🙇
github-actions commentedon Aug 17, 2026
Thanks for opening an issue! We've triaged this issue for technical review by a subject matter expert 👀
subatoi commentedon Aug 25, 2026
@erekola Thank you for your patience—
This makes sense. #45605 fixes this, but since this issue wasn't already approved for a community contribution, I wanted to ask if you're happy with that PR, or would prefer to raise your own for the attribution.
erekola commentedon Aug 25, 2026
I would rather raise my own, if that still works for you. #45605 is the same three lines I suggested in the issue and I have no argument with the content, so this is only about the attribution. Mine is #45612, the permissions block on the download job and nothing else touched.
subatoi commentedon Aug 25, 2026
No problem, that's approved and will merge and close this issue shortly—thank you for raising this, and for your interest in the GitHub docs 🙇
erekola commentedon Aug 27, 2026
The deleted comment was definitely related to the use of AI. In my opinion, these are no longer the work of humans. And no, I didn't use tokens to go through the GitHub docs. I came across it while working and thought I would fix it after checking. I would hope for the same from GitHub itself. I think there is way too much to do and it's not being done. https://turva.dev/blog/agent-readiness-code-hosts @subatoi