mirror of
https://github.com/actions/labeler.git
synced 2025-12-10 19:50:54 +00:00
feat: default repo-token to github.token (#227)
* feat: default `repo-token` to `github.token` * Update README.md * Update labeler.ts * Update index.js * Update action.yml * Update dist/index.js * Update index.js * Update dist/index.js
This commit is contained in:
@@ -99,21 +99,17 @@ jobs:
|
|||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/labeler@v4
|
- 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
|
#### Inputs
|
||||||
|
|
||||||
Various inputs are defined in [`action.yml`](action.yml) to let you configure the labeler:
|
Various inputs are defined in [`action.yml`](action.yml) to let you configure the labeler:
|
||||||
|
|
||||||
| Name | Description | Default |
|
| 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` |
|
| `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
|
# Contributions
|
||||||
|
|
||||||
|
|||||||
@@ -3,7 +3,9 @@ description: 'Automatically label new pull requests based on the paths of files
|
|||||||
author: 'GitHub'
|
author: 'GitHub'
|
||||||
inputs:
|
inputs:
|
||||||
repo-token:
|
repo-token:
|
||||||
description: 'The GITHUB_TOKEN secret'
|
description: 'The GitHub token used to manage labels'
|
||||||
|
required: false
|
||||||
|
default: ${{ github.token }}
|
||||||
configuration-path:
|
configuration-path:
|
||||||
description: 'The path for the label configurations'
|
description: 'The path for the label configurations'
|
||||||
default: '.github/labeler.yml'
|
default: '.github/labeler.yml'
|
||||||
|
|||||||
2
dist/index.js
vendored
2
dist/index.js
vendored
@@ -47,7 +47,7 @@ const minimatch_1 = __nccwpck_require__(3973);
|
|||||||
function run() {
|
function run() {
|
||||||
return __awaiter(this, void 0, void 0, function* () {
|
return __awaiter(this, void 0, void 0, function* () {
|
||||||
try {
|
try {
|
||||||
const token = core.getInput('repo-token', { required: true });
|
const token = core.getInput('repo-token');
|
||||||
const configPath = core.getInput('configuration-path', { required: true });
|
const configPath = core.getInput('configuration-path', { required: true });
|
||||||
const syncLabels = !!core.getInput('sync-labels', { required: false });
|
const syncLabels = !!core.getInput('sync-labels', { required: false });
|
||||||
const prNumber = getPrNumber();
|
const prNumber = getPrNumber();
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ type ClientType = ReturnType<typeof github.getOctokit>;
|
|||||||
|
|
||||||
export async function run() {
|
export async function run() {
|
||||||
try {
|
try {
|
||||||
const token = core.getInput('repo-token', {required: true});
|
const token = core.getInput('repo-token');
|
||||||
const configPath = core.getInput('configuration-path', {required: true});
|
const configPath = core.getInput('configuration-path', {required: true});
|
||||||
const syncLabels = !!core.getInput('sync-labels', {required: false});
|
const syncLabels = !!core.getInput('sync-labels', {required: false});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user