fix: splitting tokens
This commit is contained in:
parent
7499f866f0
commit
bd470783b8
@ -8,6 +8,12 @@ This action query the github api to get starred list of the user and then genera
|
|||||||
|
|
||||||
The github workflow token
|
The github workflow token
|
||||||
|
|
||||||
|
### `api-token`
|
||||||
|
|
||||||
|
Personal API Access Token to fetch stars from the API without incurring in Rate Limits.
|
||||||
|
|
||||||
|
You'll have to set this into the secrets yourself.
|
||||||
|
|
||||||
## Outputs
|
## Outputs
|
||||||
|
|
||||||
Output the generated list in the project `README.md`
|
Output the generated list in the project `README.md`
|
||||||
@ -18,4 +24,5 @@ Output the generated list in the project `README.md`
|
|||||||
uses: simonecorsi/mawesome@v1
|
uses: simonecorsi/mawesome@v1
|
||||||
with:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
api-token: ${{ secrets.API_TOKEN }}
|
||||||
```
|
```
|
||||||
|
@ -3,7 +3,10 @@ description: 'Generate awesome list from user starred repositories'
|
|||||||
inputs:
|
inputs:
|
||||||
github-token:
|
github-token:
|
||||||
description: 'Github token'
|
description: 'Github token'
|
||||||
default: ${{ github.token }}
|
default: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
api-token:
|
||||||
|
description: 'Personal API Token'
|
||||||
|
default: ${{ secrets.API_TOKEN }}
|
||||||
runs:
|
runs:
|
||||||
using: 'node12'
|
using: 'node12'
|
||||||
main: 'index.js'
|
main: 'index.js'
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
import got from 'got';
|
import got from 'got';
|
||||||
import * as core from '@actions/core';
|
import * as core from '@actions/core';
|
||||||
|
|
||||||
const GITHUB_TOKEN = core.getInput('github-token', { required: true });
|
const GITHUB_TOKEN = core.getInput('api-token', { required: true });
|
||||||
|
|
||||||
export default got.extend({
|
export default got.extend({
|
||||||
headers: {
|
headers: {
|
||||||
|
@ -5,13 +5,9 @@ import * as exec from '@actions/exec';
|
|||||||
|
|
||||||
const { GITHUB_REPOSITORY, GITHUB_REF } = process.env;
|
const { GITHUB_REPOSITORY, GITHUB_REF } = process.env;
|
||||||
|
|
||||||
const IS_TEST = process.env.NODE_ENV === 'test';
|
|
||||||
|
|
||||||
const branch = GITHUB_REF?.replace('refs/heads/', '');
|
const branch = GITHUB_REF?.replace('refs/heads/', '');
|
||||||
|
|
||||||
export default new (class Git {
|
export default new (class Git {
|
||||||
commandsRun: string[] = [];
|
|
||||||
|
|
||||||
constructor() {
|
constructor() {
|
||||||
const githubToken = core.getInput('github-token', { required: true });
|
const githubToken = core.getInput('github-token', { required: true });
|
||||||
core.setSecret(githubToken);
|
core.setSecret(githubToken);
|
||||||
@ -76,8 +72,6 @@ export default new (class Git {
|
|||||||
push = () => this.exec(`push origin ${branch} --follow-tags`);
|
push = () => this.exec(`push origin ${branch} --follow-tags`);
|
||||||
|
|
||||||
isShallow = async () => {
|
isShallow = async () => {
|
||||||
if (IS_TEST) return false;
|
|
||||||
|
|
||||||
const isShallow: string = await this.exec(
|
const isShallow: string = await this.exec(
|
||||||
'rev-parse --is-shallow-repository'
|
'rev-parse --is-shallow-repository'
|
||||||
);
|
);
|
||||||
|
@ -119,7 +119,7 @@ export async function run(): Promise<any> {
|
|||||||
await main();
|
await main();
|
||||||
process.exit(0);
|
process.exit(0);
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
core.error('#catchAll:');
|
core.error('#run:');
|
||||||
core.error(error);
|
core.error(error);
|
||||||
process.exit(1);
|
process.exit(1);
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user