From c3d5eb8c9506fe996a09a8ba558b12d9276f6d12 Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Wed, 26 Feb 2025 15:47:42 +0100 Subject: [PATCH 1/2] use GitHub token by default This is done by other actions too e.g. https://github.com/peter-evans/create-pull-request/blob/5354f85616108575685a73a0ddd2f67c26a441c3/action.yml#L4-L6 and https://github.com/astral-sh/setup-uv/blob/754a7d4c2dd3b94cafffb1601b919a5705eec389/action.yml#L21-L25 --- README.md | 9 +++++++-- action.yml | 2 +- 2 files changed, 8 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index e384a57e..048081bd 100644 --- a/README.md +++ b/README.md @@ -56,13 +56,18 @@ To pin the exact version: ``` The action queries the GitHub API to fetch releases data, to avoid rate limiting, -pass the default token with the `repo-token` variable: +pass the default token with the `repo-token` variable. By default, +the `GITHUB_TOKEN` secret is used, which is automatically provided by GitHub Actions. + +If the default +[permissions for the GitHub token](https://docs.github.com/en/actions/security-for-github-actions/security-guides/automatic-token-authentication#permissions-for-the-github_token) +are not sufficient, you can provide a custom GitHub token with the necessary permissions: ```yaml - name: Install Protoc uses: arduino/setup-protoc@v3 with: - repo-token: ${{ secrets.GITHUB_TOKEN }} + repo-token: ${{ secrets.CUSTOM_GITHUB_TOKEN }} ``` ## Enable verbose logging for a pipeline diff --git a/action.yml b/action.yml index 1eaff061..d2c4723d 100644 --- a/action.yml +++ b/action.yml @@ -10,7 +10,7 @@ inputs: default: 'false' repo-token: description: 'GitHub repo token to use to avoid rate limiter' - default: '' + default: ${{ github.token }} outputs: version: description: 'Actual version of the protoc compiler environment that has been installed' From dce99c95df7089223e45638937400d7b5e10f21f Mon Sep 17 00:00:00 2001 From: Kevin Stillhammer Date: Wed, 26 Feb 2025 15:48:13 +0100 Subject: [PATCH 2/2] fix integration test "invalid-version" --- .github/workflows/test-integration.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-integration.yml b/.github/workflows/test-integration.yml index 18a7ce12..82ebfbd9 100644 --- a/.github/workflows/test-integration.yml +++ b/.github/workflows/test-integration.yml @@ -81,7 +81,7 @@ jobs: version: v10.x - name: Fail the job if the action run succeeded - if: steps.setup-task.outcome == 'success' + if: steps.setup-protoc.outcome == 'success' run: | echo "::error::The action run was expected to fail, but passed!" exit 1