diff --git a/action.yml b/action.yml index ab29e8a..74a5d94 100644 --- a/action.yml +++ b/action.yml @@ -30,6 +30,10 @@ inputs: repository: description: 'Repository to make releases against, in / 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: diff --git a/src/util.ts b/src/util.ts index 6c1dce9..35e0d80 100644 --- a/src/util.ts +++ b/src/util.ts @@ -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,