mirror of
https://github.com/extractions/setup-just
synced 2026-09-07 20:04:00 +00:00
Use github token by default to authenticate download (#11)
This commit is contained in:
@@ -24,9 +24,9 @@ If you want a specific version of `just` you can specify this by passing the
|
||||
just-version: '1.4.0'
|
||||
```
|
||||
|
||||
In rare circumstances you might get rate limiting errors, this is because this
|
||||
workflow has to make requests to GitHub API in order to list available releases.
|
||||
If this happens you can set the `GITHUB_TOKEN` environment variable.
|
||||
To avoid rate-limitting, the default Github token available to all actions, is
|
||||
automatically used to authenticate calls to Github. To override it, set the environment
|
||||
variable `GITHUB_TOKEN`.
|
||||
|
||||
```yaml
|
||||
- uses: extractions/setup-just@v1
|
||||
@@ -34,11 +34,20 @@ If this happens you can set the `GITHUB_TOKEN` environment variable.
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
Alternatively, you may set the input `token`.
|
||||
|
||||
```yaml
|
||||
- uses: extractions/setup-just@v1
|
||||
input:
|
||||
github-token: ${{ secrets.MY_GITHUB_TOKEN }}
|
||||
```
|
||||
|
||||
### Inputs
|
||||
|
||||
| Name | Required | Description | Type | Default |
|
||||
| -------------- | -------- | --------------------------------------- | ------ | ------- |
|
||||
| `just-version` | no | A valid NPM-style semver specification. | string | * |
|
||||
| Name | Required | Description | Type | Default |
|
||||
| -------------- | -------- | --------------------------------------- | ------ | --------------------- |
|
||||
| `just-version` | no | A valid NPM-style semver specification. | string | * |
|
||||
| `github-token` | no | A Github token. | string | `${{ github.token }}` |
|
||||
|
||||
The semver specification is passed directly to NPM's [semver
|
||||
package](https://www.npmjs.com/package/semver). This GitHub Action will install
|
||||
|
||||
@@ -7,6 +7,10 @@ branding:
|
||||
inputs:
|
||||
just-version:
|
||||
description: 'A valid semver specifier of the just version to install'
|
||||
github-token:
|
||||
description: 'Github token to use to authenticate downloads'
|
||||
required: false
|
||||
default: ${{ github.token }}
|
||||
runs:
|
||||
using: 'node16'
|
||||
main: 'dist/index.js'
|
||||
|
||||
Vendored
+1
-1
File diff suppressed because one or more lines are too long
Generated
+7
-7
@@ -10,7 +10,7 @@
|
||||
"license": "MIT OR Apache-2.0",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.9.1",
|
||||
"@extractions/setup-crate": "^0.3.1"
|
||||
"@extractions/setup-crate": "^0.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.7.21",
|
||||
@@ -107,9 +107,9 @@
|
||||
}
|
||||
},
|
||||
"node_modules/@extractions/setup-crate": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@extractions/setup-crate/-/setup-crate-0.3.1.tgz",
|
||||
"integrity": "sha512-iudmGqmIKBVyFL2XlrcJA4VYUJLC/bL0W8FF3/fetPIsE9fMorckvVuPRt6nuHWTp687pIkZiNDbL7ttpzq6jA==",
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@extractions/setup-crate/-/setup-crate-0.4.0.tgz",
|
||||
"integrity": "sha512-Tip21gjBWwjO3kBDIIpfVVMGjGI4K31RwSMF5Z59NnbEmvQ86RkcHVrmku1ZFVn9UogobVSIzdmcUcb+IEX/JA==",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.9.1",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
@@ -1992,9 +1992,9 @@
|
||||
}
|
||||
},
|
||||
"@extractions/setup-crate": {
|
||||
"version": "0.3.1",
|
||||
"resolved": "https://registry.npmjs.org/@extractions/setup-crate/-/setup-crate-0.3.1.tgz",
|
||||
"integrity": "sha512-iudmGqmIKBVyFL2XlrcJA4VYUJLC/bL0W8FF3/fetPIsE9fMorckvVuPRt6nuHWTp687pIkZiNDbL7ttpzq6jA==",
|
||||
"version": "0.4.0",
|
||||
"resolved": "https://registry.npmjs.org/@extractions/setup-crate/-/setup-crate-0.4.0.tgz",
|
||||
"integrity": "sha512-Tip21gjBWwjO3kBDIIpfVVMGjGI4K31RwSMF5Z59NnbEmvQ86RkcHVrmku1ZFVn9UogobVSIzdmcUcb+IEX/JA==",
|
||||
"requires": {
|
||||
"@actions/core": "^1.9.1",
|
||||
"@actions/tool-cache": "^2.0.1",
|
||||
|
||||
+1
-1
@@ -21,7 +21,7 @@
|
||||
"homepage": "https://github.com/extractions/setup-just#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "^1.9.1",
|
||||
"@extractions/setup-crate": "^0.3.1"
|
||||
"@extractions/setup-crate": "^0.4.0"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^18.7.21",
|
||||
|
||||
+11
-5
@@ -3,12 +3,18 @@ import * as setup from "@extractions/setup-crate";
|
||||
|
||||
async function main() {
|
||||
try {
|
||||
const githubToken =
|
||||
process.env.GITHUB_TOKEN || core.getInput("github-token");
|
||||
|
||||
const versionSpec = core.getInput("just-version");
|
||||
const tool = await setup.checkOrInstallTool({
|
||||
owner: "casey",
|
||||
name: "just",
|
||||
versionSpec,
|
||||
});
|
||||
const tool = await setup.checkOrInstallTool(
|
||||
{
|
||||
owner: "casey",
|
||||
name: "just",
|
||||
versionSpec,
|
||||
},
|
||||
{ auth: githubToken }
|
||||
);
|
||||
core.addPath(tool.dir);
|
||||
core.info(`Successfully setup ${tool.name} v${tool.version}`);
|
||||
} catch (err) {
|
||||
|
||||
Reference in New Issue
Block a user