You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix#25088
This PR adds the support for
[`pull_request_target`](https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target)
workflow trigger. `pull_request_target` is similar to `pull_request`,
but the workflow triggered by the `pull_request_target` event runs in
the context of the base branch of the pull request rather than the head
branch. Since the workflow from the base is considered trusted, it can
access the secrets and doesn't need approvals to run.
Copy file name to clipboardExpand all lines: models/actions/run.go
+7-6Lines changed: 7 additions & 6 deletions
Original file line number
Diff line number
Diff line change
@@ -36,12 +36,13 @@ type ActionRun struct {
36
36
TriggerUser*user_model.User`xorm:"-"`
37
37
Refstring
38
38
CommitSHAstring
39
-
IsForkPullRequestbool// If this is triggered by a PR from a forked repository or an untrusted user, we need to check if it is approved and limit permissions when running the workflow.
40
-
NeedApprovalbool// may need approval if it's a fork pull request
41
-
ApprovedByint64`xorm:"index"`// who approved
42
-
Event webhook_module.HookEventType
43
-
EventPayloadstring`xorm:"LONGTEXT"`
44
-
StatusStatus`xorm:"index"`
39
+
IsForkPullRequestbool// If this is triggered by a PR from a forked repository or an untrusted user, we need to check if it is approved and limit permissions when running the workflow.
40
+
NeedApprovalbool// may need approval if it's a fork pull request
41
+
ApprovedByint64`xorm:"index"`// who approved
42
+
Event webhook_module.HookEventType// the webhook event that causes the workflow to run
43
+
EventPayloadstring`xorm:"LONGTEXT"`
44
+
TriggerEventstring// the trigger event defined in the `on` configuration of the triggered workflow
desc: "HookEventPullRequestReviewRejected(pull_request_review_rejected) doesn't match githubEventPullRequestReview(pull_request_review) with `dismissed` activity type (we don't support `dismissed` at present)",
75
+
desc: "HookEventPullRequestReviewRejected(pull_request_review_rejected) doesn't match GithubEventPullRequestReview(pull_request_review) with `dismissed` activity type (we don't support `dismissed` at present)",
"base_ref": baseRef, // string, The base_ref or target branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.
138
149
"env": "", // string, Path on the runner to the file that sets environment variables from workflow commands. This file is unique to the current step and is a different file for each step in a job. For more information, see "Workflow commands for GitHub Actions."
139
150
"event": event, // object, The full event webhook payload. You can access individual properties of the event using this context. This object is identical to the webhook payload of the event that triggered the workflow run, and is different for each event. The webhooks for each GitHub Actions event is linked in "Events that trigger workflows." For example, for a workflow run triggered by the push event, this object contains the contents of the push webhook payload.
140
-
"event_name": t.Job.Run.Event.Event(),// string, The name of the event that triggered the workflow run.
151
+
"event_name": eventName, // string, The name of the event that triggered the workflow run.
141
152
"event_path": "", // string, The path to the file on the runner that contains the full event webhook payload.
142
153
"graphql_url": "", // string, The URL of the GitHub GraphQL API.
143
154
"head_ref": headRef, // string, The head_ref or source branch of the pull request in a workflow run. This property is only available when the event that triggers a workflow run is either pull_request or pull_request_target.
0 commit comments