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