openrewrite / openrewrite/rewrite-github-actions

Modify the default permissions granted to `GITHUB_TOKEN` for a job

Open
#79 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

recipe
Dominant language
Java
Stars
1
Forks
9
Avg merge
5h 27m
Merged PRs (30d)
12

Description

From https://docs.github.com/en/actions/using-jobs/assigning-permissions-to-jobs


name: "My workflow"

on: [ push ]

permissions:
  actions: read|write|none
  checks: read|write|none
  contents: read|write|none
  deployments: read|write|none
  id-token: read|write|none
  issues: read|write|none
  discussions: read|write|none
  packages: read|write|none
  pages: read|write|none
  pull-requests: read|write|none
  repository-projects: read|write|none
  security-events: read|write|none
  statuses: read|write|none

jobs:

Example:


jobs:
  stale:
    runs-on: ubuntu-latest

    permissions:
      issues: write
      pull-requests: write

    steps:
      - uses: actions/stale@v5

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read the linked GitHub Actions permissions documentation and the YAML workflow example, then determine which default GITHUB_TOKEN permissions should change and where this repository represents that behavior. Done requires an agreed, testable definition of the new defaults; the issue does not name a repository file or test to update.

Written by the indexing model from the issue text.

Assessment

Tech stack
github-actions
Domain
devops, security
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.