Skip to content

Add permissions to workflow_run example - #45605

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

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.

@alazaouibay2004-sudo

Copy link
Copy Markdown

Arizetbest:Arizetbest-patch-1

@alazaouibay2004-sudo

Copy link
Copy Markdown

مرحبا بيك في الجزائر

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