Skip to content

Commit 81df9fc

Browse files
authored
fix(workflows): merge yml files (#53)
* fix(workflows): merge yml files * removes redundant steps and improves sequencing. * Updates to codeql-action/analyze@v4 * chore(workflow): Move typecheck to first job * chore(workflow): optimize steps in analyze job --------- Signed-off-by: Bryan Dady <[email protected]>
1 parent 76e5092 commit 81df9fc

File tree

2 files changed

+55
-73
lines changed

2 files changed

+55
-73
lines changed

.github/workflows/codeql.yml

Lines changed: 55 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,75 @@
1-
name: "CodeQL Security Scanning"
1+
name: 'CodeQL Security Scanning'
22

33
on:
44
push:
5-
branches: [ "main" ]
5+
branches: ['main']
66
pull_request:
7-
branches: [ "main" ]
7+
branches: ['main']
88
schedule:
9-
- cron: '30 1 * * 1' # Weekly on Mondays at 1:30 AM UTC
9+
- cron: '30 1 * * 1' # Weekly on Mondays at 1:30 AM UTC
1010

1111
jobs:
12+
yarn:
13+
name: Check package.json and yarn.lock consistency
14+
runs-on: ubuntu-latest
15+
steps:
16+
- uses: actions/checkout@v5
17+
- uses: actions/setup-node@v4
18+
with:
19+
node-version: '22'
20+
cache: 'yarn'
21+
22+
# Verify lockfile is up-to-date
23+
- name: Check yarn.lock consistency
24+
run: |
25+
echo "Running immutable install to verify yarn.lock..."
26+
if ! yarn install --immutable; then
27+
echo "::error::yarn.lock is out of sync with package.json. Run 'yarn install' locally and commit the updated yarn.lock"
28+
exit 1
29+
fi
30+
31+
# Run typecheck to catch type errors early
32+
- name: Type check
33+
run: yarn typecheck
34+
1235
analyze:
1336
name: Analyze Code
37+
needs: yarn
1438
runs-on: ubuntu-latest
15-
timeout-minutes: 360
1639
permissions:
1740
security-events: write
1841
packages: read
1942
actions: read
2043
contents: read
2144

2245
strategy:
23-
fail-fast: false
46+
fail-fast: true
2447
matrix:
2548
include:
26-
- language: javascript-typescript
27-
build-mode: autobuild
28-
49+
- language: javascript-typescript
50+
build-mode: autobuild
51+
2952
steps:
30-
- name: Checkout repository
31-
uses: actions/checkout@v4
32-
33-
- name: Initialize CodeQL
34-
uses: github/codeql-action/init@v3
35-
with:
36-
languages: ${{ matrix.language }}
37-
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
38-
queries: +security-and-quality
39-
40-
- name: Setup Node.js
41-
uses: actions/setup-node@v4
42-
with:
43-
node-version: '22'
44-
cache: 'yarn'
45-
46-
- name: Install dependencies and build
47-
run: |
48-
yarn install
49-
yarn build
50-
51-
- name: Perform CodeQL Analysis
52-
uses: github/codeql-action/analyze@v3
53-
with:
54-
category: "/language:${{matrix.language}}"
55-
upload: true
56-
ram: 6144 # Increase memory for large codebases
57-
threads: 2 # Number of threads to use for analysis
58-
add-snippets: true # Include code snippets in the results
53+
- name: Checkout repository
54+
uses: actions/checkout@v5
55+
56+
- name: Initialize CodeQL
57+
uses: github/codeql-action/init@v4
58+
with:
59+
languages: ${{ matrix.language }}
60+
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
61+
queries: +security-and-quality
62+
63+
- name: Setup Node.js
64+
uses: actions/setup-node@v4
65+
with:
66+
node-version: '22'
67+
cache: 'yarn'
68+
69+
- name: Install dependencies
70+
run: yarn install --immutable
71+
72+
- name: Perform CodeQL Analysis
73+
uses: github/codeql-action/analyze@v4
74+
with:
75+
category: '/language:${{matrix.language}}'

.github/workflows/yarn.yml

Lines changed: 0 additions & 35 deletions
This file was deleted.

0 commit comments

Comments
 (0)