Skip to content

Commit 6691402

Browse files
committed
Supporting data structures for the Workflows X-Ray and for Commit Times
1 parent 0f3c16b commit 6691402

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/gitxray/include/gx_definitions.py

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,30 @@
1414
REACTIONS_NEGATIVE = ['-1']
1515
REACTIONS_NEUTRAL = ['laugh', 'hooray', 'confused', 'rocket', 'eyes']
1616

17+
COMMIT_HOURS = {i: f"{i%12 if i%12 else 12}{'am' if i < 12 else 'pm'} UTC" for i in range(24)}
18+
19+
# Identifies user-supplied data as per: https://securitylab.github.com/resources/github-actions-untrusted-input/
20+
WORKFLOWS_USER_INPUT = {
21+
"Issue Title": r'\${{\s*github\.event\.issue\.title\s*}}',
22+
"Issue Body": r'\${{\s*github\.event\.issue\.body\s*}}',
23+
"Pull Request Title": r'\${{\s*github\.event\.pull_request\.title\s*}}',
24+
"Pull Request Body": r'\${{\s*github\.event\.pull_request\.body\s*}}',
25+
"Comment Body": r'\${{\s*github\.event\.comment\.body\s*}}',
26+
"Review Body": r'\${{\s*github\.event\.review\.body\s*}}',
27+
"Review Comment Body": r'\${{\s*github\.event\.review_comment\.body\s*}}',
28+
"Page Name in Pages Event": r'\${{\s*github\.event\.pages(?:\.\w+|\[\d+\])\.page_name\s*}}',
29+
"Head Commit Message": r'\${{\s*github\.event\.head_commit\.message\s*}}',
30+
"Head Commit Author\'s Email": r'\${{\s*github\.event\.head_commit\.author\.email\s*}}',
31+
"Head Commit Author\'s Name": r'\${{\s*github\.event\.head_commit\.author\.name\s*}}',
32+
"Commit Author\'s Email": r'\${{\s*github\.event\.commits(?:\.\w+|\[\d+\])\.author\.email\s*}}',
33+
"Commit Author\'s Name": r'\${{\s*github\.event\.commits(?:\.\w+|\[\d+\])\.author\.name\s*}}',
34+
"Pull Request Head Ref": r'\${{\s*github\.event\.pull_request\.head\.ref\s*}}',
35+
"Pull Request Head Label": r'\${{\s*github\.event\.pull_request\.head\.label\s*}}',
36+
"Pull Request Default Branch": r'\${{\s*github\.event\.pull_request\.head\.repo\.default_branch\s*}}',
37+
"Head Ref": r'\${{\s*github\.head_ref\s*}}',
38+
"Inputs in Event": r'\${{\s*github\.event\.inputs(?:\.\w+|\[\w+\])\s*}}',
39+
}
40+
1741
OPENPGP_SIG_TYPES = {
1842
0x00: "Signature of a binary document",
1943
0x01: "Signature of a canonical text document",

0 commit comments

Comments
 (0)