diff --git a/.github/workflows/check-dist-diff.yaml b/.github/workflows/check-dist-diff.yaml index cca3731..e933600 100644 --- a/.github/workflows/check-dist-diff.yaml +++ b/.github/workflows/check-dist-diff.yaml @@ -17,4 +17,4 @@ jobs: - name: Check diff run: | - git diff dist/ || exit 1 + git diff --exit-code dist/ || exit 1 diff --git a/README.md b/README.md index d058a50..ec2e8e6 100644 --- a/README.md +++ b/README.md @@ -20,12 +20,6 @@ jobs: git cliff ``` -## Inputs +## Action inputs and outputs -| Name | Required | Description | -| ------- | -------- | --------------------------- | -| version | false | The version of `git-cliff`. | - -## Outputs - -None. +Refer to [action.yaml](./action.yaml). diff --git a/action.yaml b/action.yaml index 8b5d0da..60544ca 100644 --- a/action.yaml +++ b/action.yaml @@ -2,6 +2,10 @@ name: Setup git-cliff description: Set up a specific version of git-cliff author: Kenji Miyake inputs: + token: + description: The token for GitHub API + default: ${{ github.token }} + required: false version: required: false description: The version of git-cliff diff --git a/dist/index.js b/dist/index.js index 8d4a11a..9e8b212 100644 --- a/dist/index.js +++ b/dist/index.js @@ -13275,7 +13275,7 @@ const core = __nccwpck_require__(2186); const tc = __nccwpck_require__(7784); const rest_1 = __nccwpck_require__(5375); async function main() { - const octokit = new rest_1.Octokit(); + const octokit = new rest_1.Octokit({ auth: core.getInput("token") }); let version = core.getInput("version"); if (version === "latest") { const latestRelease = await octokit.repos.getLatestRelease({ diff --git a/src/index.ts b/src/index.ts index e0f1e44..1fd3413 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import * as tc from "@actions/tool-cache"; import { Octokit } from "@octokit/rest"; async function main() { - const octokit = new Octokit(); + const octokit = new Octokit({ auth: core.getInput("token") }); let version = core.getInput("version"); if (version === "latest") {