Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 6876557

Browse files
committed
feat: support pull_request_target events
`pull_request` events don't have the necessary privileges to access private repos. Adding support for the `pull_request_target` event will allow private repos to also use commit lint.
1 parent b98c73f commit 6876557

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

‎README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
uses: opensource-nepal/commitlint@v1
9292
```
9393
94-
> **_NOTE:_** commitlint GitHub Actions will only be triggered by "push"or "pull_request" events.
94+
> **_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.
9595
9696
#### GitHub Action Inputs
9797

‎github_actions/run.py‎

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@
1313
# Events
1414
EVENT_PUSH = "push"
1515
EVENT_PULL_REQUEST = "pull_request"
16+
EVENT_PULL_REQUEST_TARGET = "pull_request_target"
1617

1718
# Inputs
1819
INPUT_FAIL_ON_ERROR = "INPUT_FAIL_ON_ERROR"
@@ -176,6 +177,8 @@ def main() -> None:
176177
_handle_push_event(event)
177178
elif event.event_name == EVENT_PULL_REQUEST:
178179
_handle_pr_event(event)
180+
elif event.event_name == EVENT_PULL_REQUEST_TARGET:
181+
_handle_pr_event(event)
179182
elif event.event_name is None:
180183
sys.stdout.write("No any events, skipping\n")
181184
else:

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /