Skip to content

"Add labels to an issue" doc refers to pull_requests:write permission, but should be pull-requests:write #32167

Description

@trentm

Code of Conduct

What article on docs.github.com is affected?

https://docs.github.com/en/rest/issues/labels?apiVersion=2022-11-28#add-labels-to-an-issue

What part(s) of the article would you like to see updated?

The doc says:

The token must have at least one of the following permission sets:

issues:write
pull_requests:write

but adding something like this to a GH action:

# ...
permissions:
  contents: read
  issues: write
  pull_requests: write

results in a syntax error, something like:

 Invalid workflow file

The workflow is not valid. .github/workflows/labeler.yml (Line: 12, Col: 3): Unexpected value 'pull_requests'

That permission name should be pull-requests -- with a hyphen.

Additional information

I believe (without having learned the build for this repo) a start at a fix is this change to github/docs.git:

diff --git a/src/rest/data/fpt-2022-11-28/schema.json b/src/rest/data/fpt-2022-11-28/schema.json
index d32e3d9912..1a8178247c 100644
--- a/src/rest/data/fpt-2022-11-28/schema.json
+++ b/src/rest/data/fpt-2022-11-28/schema.json
@@ -297935,7 +297935,7 @@
               "issues": "write"
             },
             {
-              "pull_requests": "write"
+              "pull-requests": "write"
             }
           ]
         },

I can open a PR for that, if that would be helpful. However:

  • there are a number of other "pull_requests": usages for permissions in that schema file
  • As well there are number of other schema files that I haven't looked at.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    contentThis issue or pull request belongs to the Docs Content teamfix-internallyTriggers a workflow to copy the issue internally and close the current issuerestContent related to rest - overview.

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions