Skip to content

Add permissions to workflow_run example - #45605

Closed
Arizetbest wants to merge 1 commit into
github:mainfrom
Arizetbest:Arizetbest-patch-1
Closed

Add permissions to workflow_run example#45605
Arizetbest wants to merge 1 commit into
github:mainfrom
Arizetbest:Arizetbest-patch-1

Conversation

@Arizetbest

Copy link
Copy Markdown

Why:

Closes: #45520

The workflow_run "Use the data" example downloads an artifact and creates a pull request comment using GITHUB_TOKEN, but the example does not explicitly declare the permissions required for these operations.

Explicitly declaring the required permissions makes the example work with repositories that use restrictive default GITHUB_TOKEN permissions and follows the principle of least privilege.

What's being changed:

This PR adds explicit job-level permissions to the download job in the workflow_run example:

permissions:
  actions: read
  issues: write
  • actions: read allows the workflow to access and download the artifact from the triggering workflow.
  • issues: write allows the workflow to create the pull request comment.

No other behavior in the example is changed.

Check off the following:

  • A subject matter expert (SME) has reviewed the technical accuracy of the content in this PR. In most cases, the author can be the SME. Open source contributions may require an SME review from GitHub staff.
  • The changes in this PR meet the docs fundamentals that are required for all content.
  • All CI checks are passing and the changes look good in the review environment.

@subatoi

subatoi commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

Hello, and thanks for raising this—

As I noted in #45520 (comment), whilst this does fix the problem, the issue in question wasn't already approved for a community contribution, so I'd like to give the OP the chance to raise a PR if they wish to. Otherwise, we'll go ahead and merge this. Thanks 🙇

@github github deleted a comment from men1986 Aug 25, 2026
@subatoi

subatoi commented Aug 25, 2026

Copy link
Copy Markdown
Contributor

As the OP has noted here, they would prefer to raise a PR for this themselves.

Thank you for your interest in the GitHub docs, but I'll go ahead and close this out—please feel free to keep an eye on issues that have been approved for community contributions (with a help wanted label) and we hope to see you in future 🙇

@subatoi subatoi closed this Aug 25, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

workflow_run "Use the data" example omits the permissions the example itself needs

2 participants