Skip to content

Commit 62162a5

Browse files
author
Alvaro Muñoz
authored
Merge pull request #89 from github/change_sources
Add new sources for github.event.changes
2 parents e147a0b + 16f1a53 commit 62162a5

File tree

5 files changed

+65
-0
lines changed

5 files changed

+65
-0
lines changed

ql/lib/ext/config/context_event_map.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,34 +4,47 @@ extensions:
44
extensible: contextTriggerDataModel
55
data:
66
- ["commit_comment", "github.event.comment"]
7+
- ["commit_comment", "github.event.changes"]
78
- ["discussion", "github.event.discussion"]
9+
- ["discussion", "github.event.changes"]
810
- ["discussion_comment", "github.event.comment"]
911
- ["discussion_comment", "github.event.discussion"]
12+
- ["discussion_comment", "github.event.changes"]
1013
- ["issues", "github.event.issue"]
14+
- ["issues", "github.event.changes"]
1115
- ["issue_comment", "github.event.issue"]
1216
- ["issue_comment", "github.event.comment"]
17+
- ["issue_comment", "github.event.changes"]
1318
- ["gollum", "github.event.pages"]
19+
- ["gollum", "github.event.changes"]
1420
- ["merge_group", "github.event.merge_group"]
1521
- ["pull_request", "github.event.pull_request"]
1622
- ["pull_request", "github.head_ref"]
23+
- ["pull_request", "github.event.changes"]
1724
- ["pull_request_comment", "github.event.comment"]
1825
- ["pull_request_comment", "github.event.pull_request"]
1926
- ["pull_request_comment", "github.head_ref"]
27+
- ["pull_request_comment", "github.event.changes"]
2028
- ["pull_request_review", "github.event.pull_request"]
2129
- ["pull_request_review", "github.event.review"]
2230
- ["pull_request_review", "github.head_ref"]
31+
- ["pull_request_review", "github.event.changes"]
2332
- ["pull_request_review_comment", "github.event.comment"]
2433
- ["pull_request_review_comment", "github.event.pull_request"]
2534
- ["pull_request_review_comment", "github.event.review"]
2635
- ["pull_request_review_comment", "github.head_ref"]
36+
- ["pull_request_review_comment", "github.event.changes"]
2737
- ["pull_request_target", "github.event.pull_request"]
2838
- ["pull_request_target", "github.head_ref"]
39+
- ["pull_request_target", "github.event.changes"]
2940
- ["push", "github.event.commits"]
3041
- ["push", "github.event.head_commit"]
42+
- ["push", "github.event.changes"]
3143
- ["repository_dispatch", "github.event.client_payload"]
3244
- ["workflow_dispatch", "github.event.inputs"]
3345
- ["workflow_run", "github.event.workflow"]
3446
- ["workflow_run", "github.event.workflow_run"]
47+
- ["workflow_run", "github.event.changes"]
3548
# workflow_call receives the same event payload as the calling workflow
3649
- ["workflow_call", "github.event.client_payload"]
3750
- ["workflow_call", "github.event.comment"]
@@ -46,4 +59,5 @@ extensions:
4659
- ["workflow_call", "github.event.review"]
4760
- ["workflow_call", "github.event.workflow"]
4861
- ["workflow_call", "github.event.workflow_run"]
62+
- ["workflow_call", "github.event.changes"]
4963

ql/lib/ext/config/untrusted_event_properties.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ extensions:
1010
- ["github\\.event\\.pages\\[[0-9]+\\]\\.page_name", "title"]
1111
- ["github\\.event\\.pages\\[[0-9]+\\]\\.title", "title"]
1212
- ["github\\.event\\.workflow_run\\.display_title", "title"]
13+
- ["github\\.event\\.changes\\.title\\.from", "title"]
1314
# URL
1415
- ["github\\.event\\.pull_request\\.head\\.repo\\.homepage", "url"]
1516
# TEXT
@@ -25,12 +26,14 @@ extensions:
2526
- ["github\\.event\\.workflow_run\\.head_repository\\.description", "text"]
2627
- ["github\\.event\\.client_payload\\[[0-9]+\\]", "text"]
2728
- ["github\\.event\\.client_payload", "text"]
29+
- ["github\\.event\\.changes\\.body\\.from", "title"]
2830
# BRANCH
2931
- ["github\\.event\\.pull_request\\.head\\.repo\\.default_branch", "branch"]
3032
- ["github\\.event\\.pull_request\\.head\\.ref", "branch"]
3133
- ["github\\.event\\.workflow_run\\.head_branch", "branch"]
3234
- ["github\\.event\\.workflow_run\\.pull_requests\\[[0-9]+\\]\\.head\\.ref", "branch"]
3335
- ["github\\.event\\.merge_group\\.head_ref", "branch"]
36+
- ["github\\.event\\.changes\\.head\\.ref\\.from", "branch"]
3437
# LABEL
3538
- ["github\\.event\\.pull_request\\.head\\.label", "label"]
3639
# EMAIL
@@ -79,5 +82,6 @@ extensions:
7982
- ["github\\.event\\.workflow_run\\.head_commit\\.committer", "json"]
8083
- ["github\\.event\\.workflow_run\\.head_repository", "json"]
8184
- ["github\\.event\\.workflow_run\\.pull_requests", "json"]
85+
- ["github\\.event\\.changes", "json"]
8286

8387

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: Pull Request Open
2+
3+
on:
4+
pull_request_target:
5+
6+
jobs:
7+
test:
8+
runs-on: ubuntu-latest
9+
steps:
10+
- run: echo "${{ github.event.changes.body.from }}"
11+
- run: echo "${{ github.event.changes.title.from }}"
12+
- run: echo "${{ github.event.changes.head.ref.from }}"
13+
- run: echo "${{ toJson(github.event.changes) }}"
14+

0 commit comments

Comments
 (0)