From 06e8b00bc9a5d50ac7e5a88d2ff879ba96412376 Mon Sep 17 00:00:00 2001
From: Caleb Maclennan
Date: Mon, 15 Mar 2021 08:17:49 +0300
Subject: [PATCH] Default to usable token with no config needed
---
README.md | 16 +++++++---------
action.yml | 3 ++-
2 files changed, 9 insertions(+), 10 deletions(-)
diff --git a/README.md b/README.md
index de8bdf6f..6cc78fc7 100644
--- a/README.md
+++ b/README.md
@@ -30,7 +30,6 @@ jobs:
override: true
- uses: actions-rs/clippy-check@v1
with:
- token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
```
@@ -47,19 +46,18 @@ jobs:
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
- token: ${{ secrets.GITHUB_TOKEN }}
args: --all-features
```
## Inputs
-| Name | Required | Description | Type | Default |
-| ------------| :------: | ---------------------------------------------------------------------------------------------------------------------------------------| ------ | --------|
-| `token` | ✓ | GitHub secret token, usually a `${{ secrets.GITHUB_TOKEN }}` | string | |
-| `toolchain` | | Rust toolchain to use; override or system default toolchain will be used if omitted | string | |
-| `args` | | Arguments for the `cargo clippy` command | string | |
-| `use-cross` | | Use [`cross`](https://github.com/rust-embedded/cross) instead of `cargo` | bool | false |
-| `name` | | Name of the created GitHub check. If running this action multiple times, each run must have a unique name. | string | clippy |
+| Name | Required | Description | Type | Default |
+| ------------| :------: | -----------------------------------------------------------------------------------------------------------| ------ | --------------------|
+| `token` | | GitHub secret token, usually a `${{ github.token }}` | string | ${{ github.token }} |
+| `toolchain` | | Rust toolchain to use; override or system default toolchain will be used if omitted | string | |
+| `args` | | Arguments for the `cargo clippy` command | string | |
+| `use-cross` | | Use [`cross`](https://github.com/rust-embedded/cross) instead of `cargo` | bool | false |
+| `name` | | Name of the created GitHub check. If running this action multiple times, each run must have a unique name. | string | clippy |
For extra details about the `toolchain`, `args` and `use-cross` inputs,
see [`cargo` Action](https://github.com/actions-rs/cargo#inputs) documentation.
diff --git a/action.yml b/action.yml
index 4b7dfdcf..52a50884 100644
--- a/action.yml
+++ b/action.yml
@@ -8,7 +8,8 @@ branding:
inputs:
token:
description: GitHub token
- required: true
+ required: false
+ default: ${{ github.token }}
toolchain:
description: Toolchain to use (without the `+` sign, ex. `nightly`)
required: false