Skip to content

Commit 7ff975a

Browse files
Merge pull request #27 from technote-space/release/v1.0.5
Release/v1.0.5
2 parents 89b5c0a + 104ac4d commit 7ff975a

File tree

4 files changed

+7
-7
lines changed

4 files changed

+7
-7
lines changed

.github/workflows/released.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ jobs:
88
- name: Release GitHub Actions
99
uses: technote-space/release-github-actions@test
1010
with:
11+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1112
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
1213
COMMIT_NAME: Technote
1314
COMMIT_EMAIL: [email protected]

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ jobs:
2525
- name: Release GitHub Actions
2626
uses: technote-space/release-github-actions@v1
2727
with:
28+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
2829
ACCESS_TOKEN: ${{ secrets.ACCESS_TOKEN }}
2930
```
3031

action.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,9 @@ name: Release GitHub Actions
22
description: GitHub actions to auto release.
33
author: technote-space
44
inputs:
5+
GITHUB_TOKEN:
6+
description: Secret GitHub API token to use for making API requests.
7+
required: true
58
ACCESS_TOKEN:
69
description: Secret GitHub Access Token to use for making push. This is not the same as GITHUB_TOKEN.
710
required: true

src/main.ts

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {setFailed} from '@actions/core';
1+
import {setFailed, getInput} from '@actions/core';
22
import {context, GitHub} from '@actions/github';
33
import signale from 'signale';
44
import {deploy} from './utils/command';
@@ -13,13 +13,8 @@ async function run() {
1313
return;
1414
}
1515

16-
if (typeof process.env.GITHUB_TOKEN === 'undefined' || process.env.GITHUB_TOKEN === '') {
17-
// noinspection ExceptionCaughtLocallyJS
18-
throw new Error(`Input required and not supplied: GITHUB_TOKEN`);
19-
}
20-
2116
signale.info(`Tag name: ${context.payload.release.tag_name}`);
22-
await deploy(context.payload.release.tag_name, new GitHub(process.env.GITHUB_TOKEN), context);
17+
await deploy(context.payload.release.tag_name, new GitHub(getInput('GITHUB_TOKEN', {required: true})), context);
2318
} catch (error) {
2419
setFailed(error.message);
2520
}

0 commit comments

Comments
 (0)