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.
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:
I find the documentation of the
ownerandrepositoriesproperties a bit misleading though.To me this means if I don't set
ownerexplicitly, owner will be set to "the current repository owner". I conclude that if my repository lives under my orgexample-org/my-repo, I expect owner to be set toexample-org."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.