Skip to content

Commit

Permalink
docs: add usage to use pull_request_target as workflow triggers (#64)
Browse files Browse the repository at this point in the history
  • Loading branch information
kentaro-m authored Nov 27, 2021
1 parent 914f9fe commit 8af7ad5
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,25 @@ jobs:
configuration-path: '.github/some_name_for_configs.yml' # Only needed if you use something other than .github/auto_assign.yml
```
Change event that triggers a workflow to the `pull_request_target` if you want to enable the auto-assign action when opening pull requests from fork repositories or bots like Dependabot.

Using dangerous misuse of the `pull_request_target` event can be a security risk, so make sure you understand pros and cons before using it.

See below for details:

- [Events that trigger workflows / Pull request target - GitHub Docs](https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#pull_request_target)
- [Events that trigger workflows / Pull request events for forked repositories - GitHub Docs](https://docs.github.com/en/actions/learn-github-actions/events-that-trigger-workflows#pull-request-events-for-forked-repositories)

```diff
name: 'Auto Assign'
on:
- pull_request:
+ pull_request_target:
types: [opened, ready_for_review]
jobs:
```

Create a separate configuration file for the auto-assign action (e.g. `.github/auto_assign.yml`).

### Single Reviewers List
Expand Down

0 comments on commit 8af7ad5

Please sign in to comment.