diff --git a/README.md b/README.md index 0a2b77e..1fdd6f0 100644 --- a/README.md +++ b/README.md @@ -9,7 +9,14 @@ This action generates a changelog based on your Git history using [git-cliff](ht - `version`: `git-cliff` version to use. (e.g. `"latest"`, `"v2.12.0"`) - `config`: Path of the configuration file. (Default: `"cliff.toml"`) - `args`: [Arguments](https://github.com/orhun/git-cliff#usage) to pass to git-cliff. (Default: `"-v"`) -- `github_token`: The GitHub API token used to get `git-cliff` release information via the GitHub API to avoid rate limits. (Default: `${{ github.token }}`) +- `github_token`: The GitHub API token used to download `git-cliff` and to authenticate git-cliff's [GitHub integration](https://git-cliff.org/docs/integration/github) (e.g. extracting usernames, contributors, PR links) to avoid rate limits. Requires a classic or fine-grained token without permissions. + +> [!NOTE] +> GitHub API token order of precedence is as follows: +> +> 1. Input variable (`github_token`) +> 2. Environment variable (`GITHUB_TOKEN`) +> 3. GitHub context (default) (`${{ github.token }}`) ### Output variables diff --git a/action.yml b/action.yml index 9f8af37..37326d5 100644 --- a/action.yml +++ b/action.yml @@ -16,7 +16,6 @@ inputs: github_token: description: "GitHub API token" required: false - default: "${{ github.token }}" outputs: changelog: description: "output file" @@ -37,14 +36,14 @@ runs: RUNNER_OS: ${{ runner.os }} RUNNER_ARCH: ${{ runner.arch }} VERSION: ${{ inputs.version }} - GITHUB_API_TOKEN: ${{ env.GITHUB_TOKEN || inputs.github_token }} + GITHUB_API_TOKEN: ${{ inputs.github_token || env.GITHUB_TOKEN || github.token }} - name: Run git-cliff id: run-git-cliff shell: bash run: ${GITHUB_ACTION_PATH}/run.sh --config=${{ inputs.config }} ${{ inputs.args }} env: - GITHUB_TOKEN: ${{ env.GITHUB_TOKEN || inputs.github_token }} + GITHUB_TOKEN: ${{ inputs.github_token || env.GITHUB_TOKEN || github.token }} branding: icon: "triangle"