Skip to content

Commit 3dc118c

Browse files
committed
Bundle action using esbuild
Remove node_modules from repository to reduce cost to download repository. Because node_modules is no longer included: * If `npm` isn't available (e.g. in a container), install it * Run `npm install` before performing various tasks Change pr-checks to not be particularly picky about the generated content because it will differ between different versions as everything is bundled together.
1 parent d67cef3 commit 3dc118c

File tree

18,886 files changed

+3121
-4740764
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

18,886 files changed

+3121
-4740764
lines changed

.github/actions/prepare-test/action.yml

+6
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,12 @@ outputs:
1919
runs:
2020
using: composite
2121
steps:
22+
- name: npm install
23+
shell: bash
24+
run: |
25+
if command -v npm >/dev/null 2>/dev/null; then
26+
npm ci
27+
fi
2228
- name: Move codeql-action
2329
shell: bash
2430
run: |

.github/actions/update-bundle/action.yml

+4
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ runs:
88
shell: bash
99
run: npm install -g ts-node
1010

11+
- name: Install
12+
shell: bash
13+
run: npm ci
14+
1115
- name: Run update script
1216
working-directory: ${{ github.action_path }}
1317
shell: bash

.github/workflows/pr-checks.yml

+19
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,9 @@ jobs:
2626
- name: Checkout
2727
uses: actions/checkout@v4
2828

29+
- name: Install
30+
run: npm install
31+
2932
- name: Lint
3033
id: lint
3134
run: npm run-script lint-ci
@@ -52,6 +55,16 @@ jobs:
5255
# `npm install` on Linux.
5356
npm install
5457
58+
(
59+
echo '*/*-action.js';
60+
echo '*/*-action-post.js'
61+
) >> .gitignore
62+
for action in $(
63+
find * -mindepth 1 -maxdepth 1 -type f -name action.yml
64+
); do
65+
git rm -f "$(dirname "$action")"/*-action*.js
66+
done
67+
5568
if [ ! -z "$(git status --porcelain)" ]; then
5669
git config --global user.email "[email protected]"
5770
git config --global user.name "github-actions[bot]"
@@ -112,6 +125,12 @@ jobs:
112125

113126
steps:
114127
- uses: actions/checkout@v4
128+
- name: npm install
129+
run: |
130+
npm ci
131+
- name: Build
132+
run: |
133+
npm run build
115134
- name: npm test
116135
run: |
117136
# Run any commands referenced in package.json using Bash, otherwise

.gitignore

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
1-
# Ignore for example failing-tests.json from AVA
2-
node_modules/.cache/
1+
# actions are bundled to make this repository lightweight for consumers
2+
node_modules/
3+
# lib is generated by tsc
4+
lib
35
# Java build files
46
.gradle/
57
*.class
@@ -8,4 +10,4 @@ node_modules/.cache/
810
# eslint sarif report
911
eslint.sarif
1012
# for local incremental compilation
11-
tsconfig.tsbuildinfo
13+
tsconfig.tsbuildinfo

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Note that the only difference between `v2` and `v3` of the CodeQL Action is the
77
## [UNRELEASED]
88

99
- The CodeQL Action now downloads bundles compressed using Zstandard on GitHub Enterprise Server when using Linux or macOS runners. This speeds up the installation of the CodeQL tools. This feature is already available to GitHub.com users. [#2573](https://github.com/github/codeql-action/pull/2573)
10+
- The CodeQL Action no longer includes node_modules. This should drammatically decrease the download size/increase download speed for `uses: github/codeql-action@...`.
1011

1112
## 3.27.0 - 22 Oct 2024
1213

analyze/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -92,5 +92,5 @@ outputs:
9292
description: The ID of the uploaded SARIF file.
9393
runs:
9494
using: node20
95-
main: "../lib/analyze-action.js"
96-
post: "../lib/analyze-action-post.js"
95+
main: "analyze-action.js"
96+
post: "analyze-action-post.js"

analyze/analyze-action-post.js

+379
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

analyze/analyze-action.js

+230
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

autobuild/action.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -16,4 +16,4 @@ inputs:
1616
required: false
1717
runs:
1818
using: node20
19-
main: '../lib/autobuild-action.js'
19+
main: 'autobuild-action.js'

autobuild/autobuild-action.js

+180
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

eslint.config.mjs

+2
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,8 @@ export default [
3131
"tests/**/*",
3232
"eslint.config.mjs",
3333
".github/**/*",
34+
"*/*-action.js",
35+
"*/*-action-post.js",
3436
],
3537
},
3638
...fixupConfigRules(

init/action.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -147,5 +147,5 @@ outputs:
147147
description: The version of the CodeQL binary used for analysis
148148
runs:
149149
using: node20
150-
main: '../lib/init-action.js'
151-
post: '../lib/init-action-post.js'
150+
main: 'init-action.js'
151+
post: 'init-action-post.js'

init/init-action-post.js

+379
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

init/init-action.js

+187
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)