-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* fix: read default token * docs: update README
- Loading branch information
Showing
2 changed files
with
17 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,36 +30,35 @@ critical: | |
Create a workflow (eg: `.github/workflows/labeler.yml` see [Creating a Workflow file](https://help.github.com/en/articles/configuring-a-workflow#creating-a-workflow-file)) to utilize the labeler action with content: | ||
|
||
``` | ||
```yml | ||
name: "Issue Labeler" | ||
on: | ||
issues: | ||
types: [opened, edited] | ||
permissions: | ||
issues: write | ||
jobs: | ||
triage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: github/[email protected] #May not be the latest version | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
configuration-path: .github/labeler.yml | ||
not-before: 2020-01-15T02:54:32Z | ||
enable-versioned-regex: 0 | ||
``` | ||
|
||
`not-before` is optional and will result in any issues prior to this timestamp to be ignored. | ||
|
||
_Note: The above workflow grants access to the `GITHUB_TOKEN` so the action can make calls to GitHub's REST API._ | ||
### Example using versioned issue templates | ||
|
||
As you iterate on your regular expressions, since maybe your issue template gets updated, this can have an impact on existing issues. The below allows you to version your regular expression definitions and pair them with issue templates. | ||
|
||
Below is the body of an example issue which has the version identifier `issue_labeler_regex_version` embedded. | ||
|
||
``` | ||
```md | ||
<!-- | ||
issue_labeler_regex_version=1 | ||
--!> | ||
|
@@ -69,19 +68,21 @@ I have an urgent issue that requires someone's attention. | |
|
||
Below is the workflow file | ||
|
||
``` | ||
```yml | ||
name: "Issue Labeler" | ||
on: | ||
issues: | ||
types: [opened, edited] | ||
permissions: | ||
issues: write | ||
jobs: | ||
triage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: github/[email protected] #May not be the latest version | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
configuration-path: .github/labeler.yml | ||
not-before: 2020-01-15T02:54:32Z | ||
enable-versioned-regex: 1 | ||
|
@@ -101,7 +102,7 @@ Set `body-missing-regex-label` to the name of the label that should be added to | |
|
||
The labeler action is also available for pull requests. Make sure the workflow is triggered by pull requests. | ||
|
||
``` | ||
```yml | ||
on: | ||
pull_request: | ||
types: [opened, edited] | ||
|
@@ -111,19 +112,21 @@ on: | |
|
||
Set `include-title` to `1` to include the issue title in addition to the body in the regular expression target. | ||
|
||
``` | ||
```yml | ||
name: "Issue Labeler" | ||
on: | ||
issues: | ||
types: [opened, edited] | ||
permissions: | ||
issues: write | ||
jobs: | ||
triage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: github/[email protected] #May not be the latest version | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
configuration-path: .github/labeler.yml | ||
enable-versioned-regex: 0 | ||
include-title: 1 | ||
|
@@ -134,14 +137,13 @@ jobs: | |
By default, labels that no longer match are not removed from the issue. To enable this functionality, explicity | ||
set `sync-labels` to `1`. | ||
|
||
``` | ||
```yml | ||
jobs: | ||
triage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: github/[email protected] | ||
with: | ||
repo-token: "${{ secrets.GITHUB_TOKEN }}" | ||
configuration-path: .github/labeler.yml | ||
enable-versioned-regex: 0 | ||
sync-labels: 1 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters