Files
git-cliff-action/action.yml
T
Gabriel Torcat 84ab5d5f60 feat(env): improve GitHub Token handling (#77)
* fix: stop `env.GITHUB_TOKEN` from overriding `github_token` input

Previously, `GITHUB_API_TOKEN` and `GITHUB_TOKEN` were resolved as
`env.GITHUB_TOKEN || inputs.github_token`, meaning the environment
variable took priority over the action input. On Forgejo/Gitea
runners, `GITHUB_TOKEN` is automatically set to a non-GitHub token,
which silently overrode any user-provided github_token input and
caused GitHub API calls to fail.

* Improve GitHub API token input handling

Updated GitHub API token handling to use fallback values.

* Clarify 'github_token' description in README

Reworded the description of the 'github_token' parameter for clarity.

* Fix formatting of GitHub token description in README

* Update README with GitHub API token precedence

Added note on GitHub API token precedence in README.

* Update README.md

---------

Co-authored-by: Maxim Slipenko <maxim@slipenko.com>
Co-authored-by: Orhun Parmaksız <orhunparmaksiz@gmail.com>
2026-04-25 00:36:42 +03:00

51 lines
1.4 KiB
YAML

name: "git-cliff - Changelog Generator"
description: "Generate changelog based on your Git history"
inputs:
version:
description: "git-cliff version"
required: false
default: "v2.12.0"
config:
description: "config file location"
required: false
default: "cliff.toml"
args:
description: "git-cliff arguments"
required: false
default: "-v"
github_token:
description: "GitHub API token"
required: false
outputs:
changelog:
description: "output file"
value: ${{ steps.run-git-cliff.outputs.changelog }}
content:
description: "content of the changelog"
value: ${{ steps.run-git-cliff.outputs.content }}
version:
description: "version of the latest release"
value: ${{ steps.run-git-cliff.outputs.version }}
runs:
using: "composite"
steps:
- name: Download git-cliff
shell: bash
run: ${GITHUB_ACTION_PATH}/install.sh
env:
RUNNER_OS: ${{ runner.os }}
RUNNER_ARCH: ${{ runner.arch }}
VERSION: ${{ inputs.version }}
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: ${{ inputs.github_token || env.GITHUB_TOKEN || github.token }}
branding:
icon: "triangle"
color: "green"