Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: support the token input #61

Merged
merged 3 commits into from
Dec 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/check-dist-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ jobs:

- name: Check diff
run: |
git diff dist/ || exit 1
git diff --exit-code dist/ || exit 1
10 changes: 2 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
4 changes: 4 additions & 0 deletions action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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") {
Expand Down