From 35d99c01679cf364a861b1eb677f89931d0905a9 Mon Sep 17 00:00:00 2001 From: Nicolas Karolak Date: Sun, 22 Sep 2024 09:39:12 +0200 Subject: [PATCH] ci: use github token by default Set `${{ github.token }}` as the default value for `github_token` input. This is the common practice, examples: * https://github.com/actions/checkout/blob/main/action.yml#L24 * https://github.com/astral-sh/setup-uv/pull/61 --- README.md | 5 +---- action.yml | 1 + 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index b49d76b..ada6605 100644 --- a/README.md +++ b/README.md @@ -52,12 +52,9 @@ jobs: uses: actions/checkout@v3 with: fetch-depth: 0 - token: "${{ secrets.GITHUB_TOKEN }}" - id: cz name: Create bump and changelog uses: commitizen-tools/commitizen-action@master - with: - github_token: ${{ secrets.GITHUB_TOKEN }} - name: Print Version run: echo "Bumped to version ${{ steps.cz.outputs.version }}" ``` @@ -66,7 +63,7 @@ jobs: | Name | Description | Default | | ------------------------------ | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------- | -| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}`. Required if `push: true` | - | +| `github_token` | Token for the repo. Can be passed in using `${{ secrets.GITHUB_TOKEN }}` if your want to use a custom PAT | `${{ github.token }}` | | `working_directory` | Change to this directory before running | repo root directory | | `dry_run` | Run without creating commit, output to stdout | false | | `repository` | Repository name to push. Default or empty value represents current github repository | current one | diff --git a/action.yml b/action.yml index f2f540c..e36a44f 100644 --- a/action.yml +++ b/action.yml @@ -47,6 +47,7 @@ inputs: github_token: description: 'Token for the repo. Can be passed in using $\{{ secrets.GITHUB_TOKEN }}' required: false + default: ${{ github.token }} repository: description: "Repository name to push. Default or empty value represents current github repository (${GITHUB_REPOSITORY})" default: ""