-
Notifications
You must be signed in to change notification settings - Fork 9
139 lines (132 loc) · 4.25 KB
/
level0.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
name: Poutine Level 0
on:
issues:
types: [opened, edited]
issue_comment:
types: [created, edited]
pull_request_target:
types: [opened, synchronize]
branches:
- main
pull_request:
types: [closed]
branches:
- main
permissions: {}
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
jobs:
fries:
runs-on: ubuntu-latest
timeout-minutes: 1
if: github.event_name == 'issues'
permissions:
id-token: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FLAG_GRAVY_OVERFLOW_L0_FRIES: ${{ secrets.FLAG_GRAVY_OVERFLOW_L0_FRIES }}
steps:
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- uses: rlespinasse/github-slug-action@v4
with:
short-length: 8
- name: Check for profanities in issue body
id: check_profanities
run: |
echo "Checking issue body for profanities..."
PROFANITIES_LIST="bad|disguting|horrible"
if echo "${{ github.event.issue.body }}" | grep -qiE "$PROFANITIES_LIST"; then
echo "Profanity detected in issue body. Please clean up the language."
exit 1
else
echo "No profanities found in issue body."
exit 0
fi
cheddar:
runs-on: ubuntu-latest
timeout-minutes: 1
if: github.event_name == 'issue_comment'
permissions:
id-token: write
issues: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FLAG_GRAVY_OVERFLOW_L0_CHEDDAR: ${{ secrets.FLAG_GRAVY_OVERFLOW_L0_CHEDDAR }}
steps:
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Mini Chat Bot
uses: actions/github-script@v7
with:
script: |
const commentBody = "${{ github.event.comment.body }}";
let response;
if (commentBody.includes("hello")) {
response = "Hello! How can I help you today?";
} else if (commentBody.includes("help")) {
response = "Sure, what do you need help with?";
} else {
response = "Sorry, I didn't understand that. Can you try again?";
}
github.rest.issues.createComment({
issue_number: context.payload.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: response
});
gravy:
runs-on: ubuntu-latest
timeout-minutes: 1
if: github.event_name == 'pull_request_target' && contains(github.event.pull_request.title, 'gravy')
permissions:
id-token: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FLAG_GRAVY_OVERFLOW_L0_GRAVY: ${{ secrets.FLAG_GRAVY_OVERFLOW_L0_GRAVY }}
steps:
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- run: |
npm install
npm run lint
npm start
toppings:
runs-on: ubuntu-latest
timeout-minutes: 1
if: github.event_name == 'pull_request' && contains(github.event.pull_request.title, 'toppings')
permissions:
id-token: write
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FLAG_GRAVY_OVERFLOW_L0_TOPPINGS: ${{ secrets.FLAG_GRAVY_OVERFLOW_L0_TOPPINGS }}
steps:
- uses: step-security/harden-runner@63c24ba6bd7ba022e95695ff85de572c04a18142 # v2.7.0
with:
egress-policy: audit
- name: Checkout PR code
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: 21
- run: |
npm install
npm run lint
- name: Log test executions
run: |
echo "Lint ran PR coming from repo with description ${{ github.event.pull_request.head.repo.description }}"