Create a token for all repositories in the current owner's installation

Open Beginner friendly
#377 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
1/5
Estimated time
1-3 hours
Newbie friendliness
72/100
Issue type
Documentation
Clarity
Clearly specified
Activity status
Quiet
Tech stack
github-actions, javascript
Domain
documentation

Research direction

Start with the linked documentation section, “Create a token for all repositories in the current owner's installation,” and review the descriptions of the owner and repositories properties. Update the wording to distinguish an explicitly set owner from the default current repository owner, then verify that the documented access scopes match the examples and reported behavior.

Written by the indexing model from the issue text.

Description

The docs currently have a section called Create a token for all repositories in the current owner's installation. It comes with a clean example:

on: [workflow_dispatch]

jobs:
  hello-world:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/create-github-app-token@v3
        id: app-token
        with:
          client-id: ${{ vars.APP_CLIENT_ID }}
          private-key: ${{ secrets.APP_PRIVATE_KEY }}
          owner: ${{ github.repository_owner }}
      - uses: peter-evans/create-or-update-comment@v4
        with:
          token: ${{ steps.app-token.outputs.token }}
          issue-number: ${{ github.event.issue.number }}
          body: "Hello, World!"

I find the documentation of the owner and repositories properties a bit misleading though.

owner
Optional: The owner of the GitHub App installation. If empty, defaults to the current repository owner.

To me this means if I don't set owner explicitly, owner will be set to "the current repository owner". I conclude that if my repository lives under my org example-org/my-repo, I expect owner to be set to example-org.

repositories
Optional: Comma or newline-separated list of repositories to grant access to.
Note
If owner is set and repositories is empty, access will be scoped to all repositories in the provided repository owner's installation. If owner and >repositories are empty, access will be scoped to only the current repository.

"If owner is set".

According to my tests, owner does not count as set when left empty, even though owner property description says it automatically falls back to the repositories owner.

Suggestion, change wording in docs to:

If owner is set explicitly and repositories is empty, access will be scoped to all repositories in the provided repository owner's installation. If owner and repositories are empty, access will be scoped to only the current repository.

Dominant language
JavaScript
Stars
886
Forks
174
PR merge metrics
No merged PRs in 30d

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.

More from actions/create-github-app-token

All issues in actions/create-github-app-token

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.