Skip to content

Commit c9a2598

Browse files
author
Evan Sims
authored
test: Additional Improvements to CI Workflows (#2438)
2 parents 698cb5d + 33915dc commit c9a2598

File tree

5 files changed

+73
-9
lines changed

5 files changed

+73
-9
lines changed

.github/workflows/codeql.yml

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,14 @@ name: CodeQL
22

33
on:
44
merge_group:
5-
push:
6-
branches: ['master', 'v6', 'v7', 'v8', 'v9-optional-signup-username', 'v9', 'v10']
75
pull_request:
8-
branches: ['master']
6+
types:
7+
- opened
8+
- synchronize
9+
push:
10+
branches:
11+
- master
12+
- v*
913
schedule:
1014
- cron: '11 10 * * 4'
1115

@@ -14,6 +18,10 @@ permissions:
1418
contents: read
1519
security-events: write
1620

21+
concurrency:
22+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
23+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
24+
1725
jobs:
1826
analyze:
1927
name: Analyze
@@ -25,6 +33,9 @@ jobs:
2533
language: [javascript]
2634

2735
steps:
36+
- if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group'
37+
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection.
38+
2839
- name: Checkout
2940
uses: actions/checkout@v4
3041

.github/workflows/publish.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ jobs:
2626
- name: Setup Node
2727
uses: actions/setup-node@v3
2828
with:
29-
node-version: ${{ env.NODE_VERSION }}
29+
node-version: 18
3030
cache: 'npm'
3131

3232
- name: Install dependencies
@@ -57,7 +57,7 @@ jobs:
5757
- name: Setup Node
5858
uses: actions/setup-node@v3
5959
with:
60-
node-version: ${{ env.NODE_VERSION }}
60+
node-version: 18
6161
registry-url: 'https://npm.pkg.github.com'
6262
cache: 'npm'
6363

.github/workflows/semgrep.yml

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,31 @@ on:
1515
permissions:
1616
contents: read
1717

18+
concurrency:
19+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
20+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
21+
1822
jobs:
1923
authorize:
2024
name: Authorize
21-
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
25+
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
2226
runs-on: ubuntu-latest
2327
steps:
2428
- run: true
2529

2630
run:
27-
if: (github.actor != 'dependabot[bot]')
2831
needs: authorize # Require approval before running on forked pull requests
2932

30-
name: Run
33+
name: Check for Vulnerabilities
3134
runs-on: ubuntu-latest
3235

3336
container:
3437
image: returntocorp/semgrep
3538

3639
steps:
40+
- if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group'
41+
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection.
42+
3743
- uses: actions/checkout@v4
3844
with:
3945
ref: ${{ github.event.pull_request.head.sha || github.ref }}

.github/workflows/snyk.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: Snyk
2+
3+
on:
4+
merge_group:
5+
workflow_dispatch:
6+
pull_request_target:
7+
types:
8+
- opened
9+
- synchronize
10+
push:
11+
branches:
12+
- master
13+
schedule:
14+
- cron: '30 0 1,15 * *'
15+
16+
permissions:
17+
contents: read
18+
19+
concurrency:
20+
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
21+
cancel-in-progress: ${{ github.ref != 'refs/heads/master' }}
22+
23+
jobs:
24+
authorize:
25+
name: Authorize
26+
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
27+
runs-on: ubuntu-latest
28+
steps:
29+
- run: true
30+
31+
check:
32+
needs: authorize
33+
34+
name: Check for Vulnerabilities
35+
runs-on: ubuntu-latest
36+
37+
steps:
38+
- if: github.actor == 'dependabot[bot]' || github.event_name == 'merge_group'
39+
run: exit 0 # Skip unnecessary test runs for dependabot and merge queues. Artifically flag as successful, as this is a required check for branch protection.
40+
41+
- uses: actions/checkout@v3
42+
with:
43+
ref: ${{ github.event.pull_request.head.sha || github.ref }}
44+
45+
- uses: snyk/actions/php@b98d498629f1c368650224d6d212bf7dfa89e4bf # pin@0.4.0
46+
env:
47+
SNYK_TOKEN: ${{ secrets.SNYK_TOKEN }}

.github/workflows/test.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ concurrency:
2121
jobs:
2222
authorize:
2323
name: Authorize
24-
environment: ${{ github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
24+
environment: ${{ github.actor != 'dependabot[bot]' && github.event_name == 'pull_request_target' && github.event.pull_request.head.repo.full_name != github.repository && 'external' || 'internal' }}
2525
runs-on: ubuntu-latest
2626
steps:
2727
- run: true

0 commit comments

Comments
 (0)