Skip to content

Error when using workflow: ”The nested job 'genmatrix' is requesting 'pull-requests: read'“ #137

@martinheise

Description

@martinheise

Module version(s) affected

^1.9

Description

I have used the workflow as described with default setup pointing to tag “v1”, both in a new repository and in an older one (both containing Silverstripe modules):

For both I get an error message now when running the CI workflow related to permission (details see below).

As the older repository used to work this way without code changes in the meantime, I tried several configurations using different tags – it seems the issue appears with branch 1.9, while 1.8. still runs fine.

How to reproduce

Setup a basic CI workflow as described on https://github.com/silverstripe/gha-ci/ in some repository:

name: CI

on:
  push:
  pull_request:
  workflow_dispatch:

jobs:
  ci:
    name: CI
    uses: silverstripe/gha-ci/.github/workflows/ci.yml@v1

and trigger the CI action manually or by pushing a branch.

The action aborts with error message:

The workflow is not valid. .github/workflows/ci.yml (Line: 9, Col: 3): Error calling workflow 'silverstripe/gha-ci/.github/workflows/ci.yml@v1'. The nested job 'genmatrix' is requesting 'pull-requests: read', but is only allowed 'pull-requests: none'. .github/workflows/ci.yml (Line: 9, Col: 3): Error calling workflow 'silverstripe/gha-ci/.github/workflows/ci.yml@v1'. The nested job 'patchrelease' is requesting 'contents: write', but is only allowed 'contents: read'.

Changing the referenced tag/branch for the included job to e.g.:

silverstripe/gha-ci/.github/workflows/[email protected]

Using branch 1.8 here still works and the job runs successfully, new branches 1.9, 1.10, 1.11, 1.12 fail with the same message.

Possible Solution

I’m not sure if this about wrong permission inside gha-ci module, or if some different setup in the repository using it is required because of some change – in the latter case just the documentation would need enhancement.

Additional Context

Thanks for checking!

Validations

  • Check that there isn't already an issue that reports the same bug
  • Double check that your reproduction steps work in a fresh installation of silverstripe/installer (with any code examples you've provided)

Notes

PRs

After merging, reassign to Guy so they can do these steps

  • Set default branch for gha-tag-release to 2
  • Manually tag 2.0.0 of gha-tag-release
  • Manually tag v2 of gha-tag-release
  • Run module standardiser against the next-patch branch

Next set of PRs

Important

DO NOT merge these until the PRs above are merged, and the steps above are complete.

After this set of PRs is merged, reassign to Guy to:

  • Tag new minor releases for the various affected gha repos
  • Redeploy elvis so it picks up on the changes
  • Archive gha-gauge-release

Metadata

Metadata

Assignees

Labels

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions