Skip to content

Commit

Permalink
Merge pull request #75 from TimonVS/feat/repo-token-config
Browse files Browse the repository at this point in the history
Allow repo token to be passed in `with` section
  • Loading branch information
TimonVS committed Nov 16, 2022
2 parents aeec1bb + 17041f9 commit 01938b9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion action.yml
Expand Up @@ -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'
Expand Down
2 changes: 1 addition & 1 deletion src/action.ts
Expand Up @@ -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 });

Expand Down

0 comments on commit 01938b9

Please sign in to comment.