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

feat: default repo-token to github.token #227

Merged
merged 10 commits into from Mar 7, 2023
Merged
Show file tree
Hide file tree
Changes from 6 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
8 changes: 2 additions & 6 deletions README.md
Expand Up @@ -99,21 +99,17 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/labeler@v4
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
```

_Note: This grants access to the `GITHUB_TOKEN` so the action can make calls to GitHub's rest API_

#### Inputs

Various inputs are defined in [`action.yml`](action.yml) to let you configure the labeler:

| Name | Description | Default |
| - | - | - |
| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret, with `contents:read` and `pull-requests:write` access | N/A |
| `repo-token` | Token to use to authorize label changes. Typically the GITHUB_TOKEN secret, with `contents:read` and `pull-requests:write` access | `github.token` |
| `configuration-path` | The path to the label configuration file | `.github/labeler.yml` |
| `sync-labels` | Whether or not to remove labels when matching files are reverted or no longer changed by the PR | `false`
| `sync-labels` | Whether or not to remove labels when matching files are reverted or no longer changed by the PR | `false`|

# Contributions

Expand Down
2 changes: 2 additions & 0 deletions action.yml
Expand Up @@ -4,6 +4,8 @@ author: 'GitHub'
inputs:
repo-token:
description: 'The GITHUB_TOKEN secret'
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
required: false
default: ${{ github.token }}
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
configuration-path:
description: 'The path for the label configurations'
default: '.github/labeler.yml'
Expand Down
4 changes: 2 additions & 2 deletions dist/index.js
Expand Up @@ -47,7 +47,7 @@ const minimatch_1 = __nccwpck_require__(3973);
function run() {
return __awaiter(this, void 0, void 0, function* () {
try {
const token = core.getInput('repo-token', { required: true });
const token = core.getInput('repo-token');
const configPath = core.getInput('configuration-path', { required: true });
const syncLabels = !!core.getInput('sync-labels', { required: false });
const prNumber = getPrNumber();
Expand Down Expand Up @@ -15251,4 +15251,4 @@ const labeler_1 = __nccwpck_require__(5272);

module.exports = __webpack_exports__;
/******/ })()
;
;
MichaelDeBoey marked this conversation as resolved.
Show resolved Hide resolved
2 changes: 1 addition & 1 deletion src/labeler.ts
Expand Up @@ -13,7 +13,7 @@ type ClientType = ReturnType<typeof github.getOctokit>;

export async function run() {
try {
const token = core.getInput('repo-token', {required: true});
const token = core.getInput('repo-token');
const configPath = core.getInput('configuration-path', {required: true});
const syncLabels = !!core.getInput('sync-labels', {required: false});

Expand Down