actions / actions/runner

`needs`/`if` should prevent errors about nested jobs violating permissions

Open
#4,151 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C#
Stars
6.3k
Forks
1.4k
Avg merge
1d 16h
Merged PRs (30d)
24

Description

https://github.com/actions/runner/blob/c96dcd472907e514274cdb4af281116adf7aad18/src/Sdk/WorkflowParser/Conversion/PermissionsHelper.cs#L43

https://github.com/check-spelling-sandbox/rancher-dashboard/actions/runs/20184527336/workflow

Workflow failure

Annotations

1 error
Invalid workflow file: .github/workflows/test-extension-workflows-release-2.8.yml#L63
The workflow is not valid. .github/workflows/test-extension-workflows-release-2.8.yml (Line: 63, Col: 3): Error calling workflow 'rancher/dashboard/.github/workflows/release-shell-pkg.yaml@release-2.8'. The nested job 'build' is requesting 'packages: write', but is only allowed 'packages: read'.


Repository authors will do this (this repository did it repeatedly) and there doesn't seem to be a good reason to demand authors get this right.

There doesn't appear to be any way to guard against this, as even if doesn't help:

https://github.com/check-spelling-sandbox/rancher-dashboard/actions/runs/20199790260/workflow

Image

Annotations

1 error
Invalid workflow file: .github/workflows/test-extension-workflows-release-2.9.yml#L64
The workflow is not valid. .github/workflows/test-extension-workflows-release-2.9.yml (Line: 64, Col: 3): Error calling workflow 'rancher/dashboard/.github/workflows/release-shell-pkg.yaml@release-2.9'. The nested job 'build' is requesting 'packages: write', but is only allowed 'packages: read'.

Contributor guide

No contributing guide indexed for this repository

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

Start in src/Sdk/WorkflowParser/Conversion/PermissionsHelper.cs around line 43, then compare its validation with the linked failing workflow runs and nested workflow examples. The work is done when jobs guarded by needs or if no longer produce permission-violation errors for nested jobs when the guarded path will not run.

Written by the indexing model from the issue text.

Assessment

Tech stack
csharp
Domain
ci-cd
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
38/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.