diff --git a/action.yml b/action.yml index a41ce35b..4d825591 100644 --- a/action.yml +++ b/action.yml @@ -2,8 +2,11 @@ name: 'PR Labeler' description: 'Automatically labels your PRs based on branch name patterns like feature/* or fix/*.' author: 'Timon van Spronsen' inputs: + repo-token: + description: 'Token for the repository. Can be passed in using `{{ secrets.GITHUB_TOKEN }}`' + default: ${{ github.token }} configuration-path: - description: 'The path for the label configurations' + description: 'Path to label configurations' default: '.github/pr-labeler.yml' branding: icon: 'tag' diff --git a/src/action.ts b/src/action.ts index 1ef77b32..a042f434 100644 --- a/src/action.ts +++ b/src/action.ts @@ -12,7 +12,7 @@ const defaultConfig = { async function action(context: Context = github.context) { try { - const GITHUB_TOKEN = process.env.GITHUB_TOKEN!; + const GITHUB_TOKEN = process.env.GITHUB_TOKEN ?? core.getInput('repo-token', { required: true }); const octokit = github.getOctokit(GITHUB_TOKEN).rest; const configPath = core.getInput('configuration-path', { required: true });