Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow repo token to be passed in with section #75

Merged
merged 1 commit into from Nov 16, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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