Accept PAT as input and default to typically usable value

This commit is contained in:
Caleb Maclennan 2021-03-16 07:50:02 +03:00
parent affa18ef97
commit d5e4f508ae
No known key found for this signature in database
GPG key ID: 63CC496475267693
2 changed files with 6 additions and 1 deletions

View file

@ -30,6 +30,10 @@ inputs:
repository:
description: 'Repository to make releases against, in <owner>/<repo> format'
required: false
token:
description: 'Authorized secret GitHub Personal Access Token. Defaults to github.token'
required: false
default: ${{ github.token }}
env:
'GITHUB_TOKEN': 'As provided by Github Actions'
outputs:

View file

@ -1,3 +1,4 @@
import { getInput } from "@actions/core";
import * as glob from "glob";
import { lstatSync, readFileSync } from "fs";
@ -40,7 +41,7 @@ export const parseInputFiles = (files: string): string[] => {
export const parseConfig = (env: Env): Config => {
return {
github_token: env.GITHUB_TOKEN || "",
github_token: getInput("token") || env.GITHUB_TOKEN || "",
github_ref: env.GITHUB_REF || "",
github_repository: env.INPUT_REPOSITORY || env.GITHUB_REPOSITORY || "",
input_name: env.INPUT_NAME,