Skip to content

Commit f1f40a0

Browse files
authored
docs: update README with pull_request_target example (#1561)
* fix: update README with pull_request_target example Now that #1560 has merged it is helpful to have this example in the README Signed-off-by: jmeridth <[email protected]> * fix: move to auto-labeller section Signed-off-by: jmeridth <[email protected]> --------- Signed-off-by: jmeridth <[email protected]>
1 parent ebb69bb commit f1f40a0

1 file changed

Lines changed: 21 additions & 3 deletions

File tree

README.md

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -390,9 +390,27 @@ You can add automatically a label into a pull request, with the `autolabeler`
390390
action.
391391

392392
```yaml
393-
steps:
394-
# runs autolabeler
395-
- uses: release-drafter/release-drafter/autolabeler@latest
393+
name: Auto Label
394+
395+
on:
396+
pull_request:
397+
# Only following types are handled by the action, but one can default to all as well
398+
types: [opened, reopened, synchronize]
399+
# pull_request_target event is required for autolabeler to support PRs from forks
400+
# pull_request_target:
401+
# types: [opened, reopened, synchronize]
402+
403+
permissions:
404+
contents: read
405+
406+
jobs:
407+
auto_label:
408+
permissions:
409+
pull-requests: write
410+
runs-on: ubuntu-latest
411+
steps:
412+
# runs autolabeler
413+
- uses: release-drafter/release-drafter/autolabeler@latest
396414
```
397415

398416
Available matchers are `files` (glob), `branch` (regex), `title` (regex) and

0 commit comments

Comments
 (0)