Skip to content

Commit

Permalink
feat: support pull_request_target events (#52)
Browse files Browse the repository at this point in the history
  • Loading branch information
kadams54 committed Jul 2, 2024
1 parent 2310d7e commit 62e1128
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ jobs:
uses: opensource-nepal/commitlint@v1
```

> **_NOTE:_** commitlint GitHub Actions will only be triggered by "push" or "pull_request" events.
> **_NOTE:_** commitlint GitHub Actions will only be triggered by "push", "pull_request", or "pull_request_target" events. The difference between "pull_request" and "pull_request_target" is that "pull_request" is more secure for public repos while "pull_request_target" is necessary for private repos.

#### GitHub Action Inputs

Expand Down
3 changes: 2 additions & 1 deletion github_actions/run.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
# Events
EVENT_PUSH = "push"
EVENT_PULL_REQUEST = "pull_request"
EVENT_PULL_REQUEST_TARGET = "pull_request_target"

# Inputs
INPUT_FAIL_ON_ERROR = "INPUT_FAIL_ON_ERROR"
Expand Down Expand Up @@ -174,7 +175,7 @@ def main() -> None:

if event.event_name == EVENT_PUSH:
_handle_push_event(event)
elif event.event_name == EVENT_PULL_REQUEST:
elif event.event_name in {EVENT_PULL_REQUEST, EVENT_PULL_REQUEST_TARGET}:
_handle_pr_event(event)
elif event.event_name is None:
sys.stdout.write("No any events, skipping\n")
Expand Down

0 comments on commit 62e1128

Please sign in to comment.