feat: allow repositories input to be comma or newline-separated (#169)

Resolves https://github.com/actions/create-github-app-token/issues/106

- Fixes the parsing to cope with whitespace in the input string.
- Allows the input to be comma or newline-separated. (I've done this for
all array-type inputs in my own actions, but I'm happy to remove this if
you only want to support comma-separated.)
- Added tests for parsing comma and newline-separated inputs.
This commit is contained in:
Peter Evans
2024-09-11 21:54:50 +01:00
committed by GitHub
parent 3378cda945
commit 796b88dc58
10 changed files with 75 additions and 37 deletions

View File

@@ -163,7 +163,9 @@ jobs:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}
repositories: "repo1,repo2"
repositories: |
repo1
repo2
- uses: peter-evans/create-or-update-comment@v3
with:
token: ${{ steps.app-token.outputs.token }}
@@ -302,7 +304,7 @@ steps:
### `repositories`
**Optional:** Comma-separated list of repositories to grant access to.
**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.