Skip to content

Example code does not properly grant permissions for opening PullRequests #1151

Description

@kastl-ars

Is there an existing issue for this?

  • I have searched the existing issues

Current Behavior

The example does contain sample code for allowing the action to open up a Pull Request. However, it seems to not be working (anymore).

permissions:
  contents: write
  pull-requests: write

jobs:
  updatecli:
[...]

In my test repository, using the "default" token available in the workflow, the action was allowed to create a new branch, but not a pull request.

ERROR: running actions failed: errors occurred while running actions:
	* creating pull request: GitHub Actions is not permitted to create or approve pull requests

Expected Behavior

The example configuration should be usable "as is" and contain code that securely allows the action to open up pull requests.

If this is not possible, the README should explain how to do this, i.e. which permissions are needed or should be left out etc.

Anything else?

Kind Regards,
Johannes

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions