Accept PAT as input and default to typically usable value
This commit is contained in:
parent
affa18ef97
commit
d5e4f508ae
@ -30,6 +30,10 @@ inputs:
|
|||||||
repository:
|
repository:
|
||||||
description: 'Repository to make releases against, in <owner>/<repo> format'
|
description: 'Repository to make releases against, in <owner>/<repo> format'
|
||||||
required: false
|
required: false
|
||||||
|
token:
|
||||||
|
description: 'Authorized secret GitHub Personal Access Token. Defaults to github.token'
|
||||||
|
required: false
|
||||||
|
default: ${{ github.token }}
|
||||||
env:
|
env:
|
||||||
'GITHUB_TOKEN': 'As provided by Github Actions'
|
'GITHUB_TOKEN': 'As provided by Github Actions'
|
||||||
outputs:
|
outputs:
|
||||||
|
@ -1,3 +1,4 @@
|
|||||||
|
import { getInput } from "@actions/core";
|
||||||
import * as glob from "glob";
|
import * as glob from "glob";
|
||||||
import { lstatSync, readFileSync } from "fs";
|
import { lstatSync, readFileSync } from "fs";
|
||||||
|
|
||||||
@ -40,7 +41,7 @@ export const parseInputFiles = (files: string): string[] => {
|
|||||||
|
|
||||||
export const parseConfig = (env: Env): Config => {
|
export const parseConfig = (env: Env): Config => {
|
||||||
return {
|
return {
|
||||||
github_token: env.GITHUB_TOKEN || "",
|
github_token: getInput("token") || env.GITHUB_TOKEN || "",
|
||||||
github_ref: env.GITHUB_REF || "",
|
github_ref: env.GITHUB_REF || "",
|
||||||
github_repository: env.INPUT_REPOSITORY || env.GITHUB_REPOSITORY || "",
|
github_repository: env.INPUT_REPOSITORY || env.GITHUB_REPOSITORY || "",
|
||||||
input_name: env.INPUT_NAME,
|
input_name: env.INPUT_NAME,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user