mirror of
https://github.com/renovatebot/github-action.git
synced 2026-12-06 03:42:57 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
1c65cdc629 | ||
|
|
fb79c568e6 | ||
|
|
69f9520c89 | ||
|
|
d74b4b53eb | ||
|
|
74cbf5ab59 | ||
|
|
4c9a834539 | ||
|
|
7c08f67ea3 | ||
|
|
111fda93ed | ||
|
|
fccaa31926 | ||
|
|
0b51b2220f | ||
|
|
b9e378b916 | ||
|
|
c86138fda5 | ||
|
|
33a6e35244 | ||
|
|
2a5e48d77b | ||
|
|
2ceaae20c5 | ||
|
|
5b8d8fbe07 | ||
|
|
c72df28eab | ||
|
|
6ab059782f | ||
|
|
3a2d0bffe9 | ||
|
|
a2bc8046aa | ||
|
|
ebb137b04b | ||
|
|
83c396a9ed | ||
|
|
81e69a5bf4 | ||
|
|
463ff52250 | ||
|
|
687d9eac0e | ||
|
|
9794296de3 | ||
|
|
dff7b2861a | ||
|
|
5b8928114e | ||
|
|
03c2ca4802 | ||
|
|
455b170642 | ||
|
|
5b7b5fd7e0 | ||
|
|
5cbd0fbf59 | ||
|
|
c4a4d2741a | ||
|
|
2b0b3fef9a | ||
|
|
b22623026b | ||
|
|
e14993c372 | ||
|
|
74ceeb3245 | ||
|
|
150eebfe07 | ||
|
|
6989750d00 | ||
|
|
ff6322a272 | ||
|
|
9caf1a2d32 | ||
|
|
0dd07533c0 | ||
|
|
4158e8f962 | ||
|
|
aad7f0754d | ||
|
|
c46f96b09a | ||
|
|
2335d1f082 | ||
|
|
7b1b9c4223 | ||
|
|
33c2ab717c | ||
|
|
c2d28c6264 | ||
|
|
82d2e85cd5 | ||
|
|
fb2cac3622 | ||
|
|
09971cb141 | ||
|
|
1676fab4b5 | ||
|
|
d010ec83cc | ||
|
|
17ecfa9701 | ||
|
|
a585c348f7 | ||
|
|
64d3298690 | ||
|
|
92dd9817b4 | ||
|
|
d1a41a58a7 | ||
|
|
5e78eb2834 | ||
|
|
cb4e515cdc | ||
|
|
864b3a0108 | ||
|
|
9dc9b6c86b | ||
|
|
e412e5dbb5 | ||
|
|
d6a947e7ac | ||
|
|
42d3b8e657 | ||
|
|
0d5a840964 | ||
|
|
5a0e1873d3 | ||
|
|
826b9e2cbe | ||
|
|
dda35e12d8 | ||
|
|
7dafa2c5b7 | ||
|
|
77b84cc56d | ||
|
|
528fe4dd18 | ||
|
|
b3074aebb2 | ||
|
|
3599594b5b | ||
|
|
13ca6de78c | ||
|
|
b1cefd0719 | ||
|
|
84d23fd9f7 | ||
|
|
e12ca56c10 | ||
|
|
936d4f4ee8 | ||
|
|
244c1f8818 | ||
|
|
9d68ada621 | ||
|
|
43dab2536d | ||
|
|
7342b5614d | ||
|
|
1f49dbe404 | ||
|
|
978179dff6 | ||
|
|
7dd9ee5f39 | ||
|
|
595142ff1d | ||
|
|
c702015e6c | ||
|
|
86f37ee37f | ||
|
|
dcb242ea32 | ||
|
|
a67f86162e | ||
|
|
e4eaa5a06a | ||
|
|
7aad75b549 | ||
|
|
836748ae81 | ||
|
|
ff33ff4139 | ||
|
|
b8078806ea | ||
|
|
d7734106be | ||
|
|
68b9d435a8 | ||
|
|
874fcf9401 | ||
|
|
1691ba021d | ||
|
|
e6cdc28726 | ||
|
|
ba55a4a4a5 | ||
|
|
ade53b997e | ||
|
|
5a957c30cc | ||
|
|
50731160a3 | ||
|
|
3915f64f45 | ||
|
|
e2a16bc9d0 | ||
|
|
7ef025feb8 | ||
|
|
db1b14ffdf | ||
|
|
0a4dd2f3a2 | ||
|
|
b83587e89c | ||
|
|
ca1fd1dbeb | ||
|
|
7df582733e | ||
|
|
4f900c9b79 | ||
|
|
caa2df4b8e | ||
|
|
06694bfd00 | ||
|
|
655c0c612a | ||
|
|
82ce65afba | ||
|
|
a618bd8368 | ||
|
|
8619803b12 | ||
|
|
3024097d00 | ||
|
|
1f2fea5305 | ||
|
|
c146ed8113 | ||
|
|
c457403ffc | ||
|
|
f8d5298559 | ||
|
|
2b92a30956 | ||
|
|
49e362489b | ||
|
|
f94f7f970e | ||
|
|
e5da266a5b | ||
|
|
640ecd94bd | ||
|
|
789717b034 | ||
|
|
1ee39a5700 | ||
|
|
6b977b4cb1 | ||
|
|
4322c8344d | ||
|
|
8211ac580e | ||
|
|
fc18e8cb6d | ||
|
|
0268d442e1 | ||
|
|
3a69550a59 | ||
|
|
5338500209 | ||
|
|
7dcb68a5f0 | ||
|
|
35f4bc22e4 | ||
|
|
13a6643c6b | ||
|
|
60f06e01c0 | ||
|
|
08bd6f57d6 | ||
|
|
b903b77667 | ||
|
|
0034d4ae77 | ||
|
|
033e466982 | ||
|
|
e0e5636eaf | ||
|
|
dad6ea12f8 | ||
|
|
53c425fba7 | ||
|
|
57a15746b4 | ||
|
|
ce1c77c1af | ||
|
|
4100b0ce6e | ||
|
|
aae434890e | ||
|
|
f9fcd2688d | ||
|
|
52c894a6cb | ||
|
|
a3637cb2f2 | ||
|
|
8858a8a4a4 | ||
|
|
2999faecc8 | ||
|
|
f21c32a356 | ||
|
|
2b2d82943a | ||
|
|
30079cbe21 | ||
|
|
f768b69ffa | ||
|
|
11bc812326 | ||
|
|
131ef08faf | ||
|
|
2e6ca9ec70 | ||
|
|
b584fee7b6 | ||
|
|
c8b6a09cd7 | ||
|
|
8f5322c12f | ||
|
|
e732b6b806 | ||
|
|
be01fa4150 | ||
|
|
6dc898e1c2 | ||
|
|
5aab9d0606 | ||
|
|
7301f98565 | ||
|
|
3764cd4418 | ||
|
|
42fe894f46 | ||
|
|
12eb5e60a5 | ||
|
|
ec49179862 | ||
|
|
e188144305 | ||
|
|
ad056132e4 | ||
|
|
f5fc834021 | ||
|
|
106d4f24c5 | ||
|
|
0e5c7f0563 | ||
|
|
a466fae9e4 | ||
|
|
b95a3a7815 | ||
|
|
7679c1ef41 | ||
|
|
260848167f | ||
|
|
3812d05385 | ||
|
|
17b69f1f26 | ||
|
|
d7d6c896e4 | ||
|
|
7ef311e0d2 | ||
|
|
9beeeb2ef2 | ||
|
|
70534fef26 | ||
|
|
d381702eb2 | ||
|
|
f2c58e1900 | ||
|
|
e227a8c411 | ||
|
|
ec93b4627b | ||
|
|
79cb38b36f | ||
|
|
b8bbc09906 | ||
|
|
1910748df5 | ||
|
|
22c027e1e7 | ||
|
|
691a7932b2 | ||
|
|
96799a95c3 | ||
|
|
cf5a505c21 | ||
|
|
7908e4fc29 | ||
|
|
b51f0b964d | ||
|
|
f6ec2078dd | ||
|
|
8ee575f99a | ||
|
|
3952bd7836 | ||
|
|
5e11aeef2d | ||
|
|
2eee4a7176 | ||
|
|
19f5c153a1 | ||
|
|
4b3830467f | ||
|
|
7d0e062ca1 | ||
|
|
bb57e331b3 | ||
|
|
32dde945e9 | ||
|
|
7966fc2125 | ||
|
|
f6095f8e58 | ||
|
|
02c6f87e0f | ||
|
|
0bd3877d11 | ||
|
|
0df06053de | ||
|
|
3b0878d813 | ||
|
|
e50c24ab67 | ||
|
|
00231c61c8 | ||
|
|
328b1d42de | ||
|
|
2b233e8978 | ||
|
|
0b4c5270cb | ||
|
|
4dc4d274fa | ||
|
|
55001989bb | ||
|
|
c13f5f24f6 | ||
|
|
6188a0c715 | ||
|
|
53c1ef55f7 | ||
|
|
7975656519 | ||
|
|
b79cd8a4ca | ||
|
|
53e912f453 | ||
|
|
136fb78be6 | ||
|
|
89d3813b20 | ||
|
|
41696162c3 | ||
|
|
02aad2e3d4 | ||
|
|
bc1bff7af9 | ||
|
|
28cde47d2a | ||
|
|
d4b970c6ac | ||
|
|
06c5166de5 | ||
|
|
42a2b18582 | ||
|
|
0f1c12dbc6 | ||
|
|
b26a35aeca | ||
|
|
2d05a6512e | ||
|
|
0bab2c57f2 | ||
|
|
8bd126b786 | ||
|
|
77fb791ff2 | ||
|
|
28f2366a0e | ||
|
|
358a0775c9 | ||
|
|
5da1c80a4c | ||
|
|
0bef368093 | ||
|
|
9c8519501f | ||
|
|
5c99478576 | ||
|
|
8cb78944a7 | ||
|
|
02b4ff2671 | ||
|
|
c57c085660 | ||
|
|
7499a886f1 | ||
|
|
52ad5d38b7 | ||
|
|
7baa54cd30 | ||
|
|
71cd5440c5 | ||
|
|
8353634116 | ||
|
|
ec55b16546 | ||
|
|
c3d480d13b | ||
|
|
3bcac2a4c9 | ||
|
|
605f61f77c | ||
|
|
9cbcae9461 | ||
|
|
37aa7bfde1 | ||
|
|
1910f63c03 | ||
|
|
6d1dae4b50 | ||
|
|
5d0a71ba13 | ||
|
|
6686ed7863 | ||
|
|
fbf9352695 | ||
|
|
0a1d328a52 | ||
|
|
1174aa05cb | ||
|
|
39c12e1a9c | ||
|
|
59e17b75b7 | ||
|
|
b9dd163d5d | ||
|
|
a4f39d41ec | ||
|
|
e46aa75031 | ||
|
|
79f1e3b5b0 | ||
|
|
4c7d0d9ea1 | ||
|
|
4cf489f4b0 | ||
|
|
eba14dd3ea | ||
|
|
05e88760cf | ||
|
|
c3a2bd1158 | ||
|
|
f33fe7241f | ||
|
|
61d3770654 | ||
|
|
97cf1d4e3b | ||
|
|
a4563876fd | ||
|
|
269c3af937 | ||
|
|
30566fb8b8 | ||
|
|
04a394c2db | ||
|
|
353cd85915 | ||
|
|
1b0a913e04 | ||
|
|
04e2cd2b08 | ||
|
|
84aeb30379 | ||
|
|
ee1d15a199 | ||
|
|
751c83e276 | ||
|
|
f608e1e32d | ||
|
|
3a7a14e2ba | ||
|
|
8fe5c6dfa0 | ||
|
|
f3cb074c89 | ||
|
|
1928ae2daa | ||
|
|
7180b34a05 | ||
|
|
80cbf31e72 | ||
|
|
7b238e1df4 | ||
|
|
2f4912b384 | ||
|
|
c2a6d5bc50 | ||
|
|
a42d278a4a | ||
|
|
ce3cb3c98c | ||
|
|
7da2254a38 | ||
|
|
c30aacd11c | ||
|
|
f7c5521c78 | ||
|
|
3db262bdf4 | ||
|
|
adf80936bd | ||
|
|
95666730ed | ||
|
|
77ce7af62b | ||
|
|
b59ff28581 | ||
|
|
ea2a81fe6a | ||
|
|
a3dcbc0638 | ||
|
|
d0a9371db8 | ||
|
|
5c3488d5d4 | ||
|
|
b4f064c9c6 | ||
|
|
2b0a3bc4e2 | ||
|
|
83a881106c | ||
|
|
87e9976a08 | ||
|
|
102fcda6ff | ||
|
|
44f6a26061 | ||
|
|
c779483e62 | ||
|
|
8f142b7a5c | ||
|
|
9f38494f5c | ||
|
|
ee25d79009 | ||
|
|
e95f533603 | ||
|
|
cc6b4fdbf8 | ||
|
|
25a4af1f2e | ||
|
|
567c762357 | ||
|
|
0ff294b17c | ||
|
|
069b9cf704 | ||
|
|
1116a13e31 | ||
|
|
7b6e4251a0 | ||
|
|
0ee9c2ea3b | ||
|
|
c095c1316a | ||
|
|
26e80d7c19 | ||
|
|
f9cdda8656 | ||
|
|
7375883297 | ||
|
|
5baef081e1 | ||
|
|
afb30f4982 | ||
|
|
9932a53026 | ||
|
|
1267b3b4db | ||
|
|
633392a69c | ||
|
|
ea18c2e07c | ||
|
|
6a157a4335 | ||
|
|
f0a619ef9c | ||
|
|
d1f2f24e7f | ||
|
|
883ae642f2 | ||
|
|
86f2a8064d | ||
|
|
938ed93f59 | ||
|
|
5cd24adcef | ||
|
|
bf4cc1ff4e | ||
|
|
85f650a31f | ||
|
|
a5be909db6 | ||
|
|
9415e11953 | ||
|
|
feaab1c8ef | ||
|
|
8a657955d8 | ||
|
|
3246316b1b | ||
|
|
98e0ed8635 | ||
|
|
d752f77423 | ||
|
|
e9f2ac4500 | ||
|
|
dde9114b56 | ||
|
|
af215a68e6 | ||
|
|
9a662eda4d | ||
|
|
3c7c001175 | ||
|
|
a0d7cddc4d | ||
|
|
6f6352adff | ||
|
|
0fb22f8237 | ||
|
|
eb8043b7da | ||
|
|
864bdfb63b | ||
|
|
16a343c671 | ||
|
|
cafb9fc466 | ||
|
|
309c38e93b | ||
|
|
94452c3ebc | ||
|
|
f9177cc67d | ||
|
|
70780c81df | ||
|
|
0a874f55c6 | ||
|
|
9678abb2db | ||
|
|
9f9a41cc40 | ||
|
|
74d63c472a | ||
|
|
444f85951a | ||
|
|
f4382f3981 | ||
|
|
4cad88b2dd | ||
|
|
f025245430 | ||
|
|
6499d3c510 | ||
|
|
1cd1a2c5f2 | ||
|
|
28e9632228 | ||
|
|
5b788d96b0 | ||
|
|
f86c441853 | ||
|
|
be174160cf | ||
|
|
10b126097a | ||
|
|
af427b231b | ||
|
|
fe1b83aa7b | ||
|
|
0487cbbb33 | ||
|
|
7e92667b73 | ||
|
|
831a3592dd | ||
|
|
e86159cea9 | ||
|
|
fd7d5966de | ||
|
|
04f2d31f4a | ||
|
|
bb3e8924a0 | ||
|
|
f90138eb2e | ||
|
|
e1e3c6c033 | ||
|
|
565219c53e | ||
|
|
b627003cc4 | ||
|
|
c23b6a866a | ||
|
|
424eb4fff2 | ||
|
|
ec0831d4e7 | ||
|
|
e5954bd31c | ||
|
|
e7be5831c9 | ||
|
|
795df715dd | ||
|
|
f9443be88a | ||
|
|
feaf0d0c45 | ||
|
|
da164b4f33 | ||
|
|
79ec7f083c | ||
|
|
cab6771375 | ||
|
|
bf23a162d6 | ||
|
|
6df812d62c | ||
|
|
f4811ffb41 | ||
|
|
f573af67f8 | ||
|
|
6a2bbb216c | ||
|
|
e233cdb831 | ||
|
|
f5a8a87bdb | ||
|
|
015201b4a8 | ||
|
|
ea29cdff37 | ||
|
|
9acd283e82 | ||
|
|
17f77f9c42 | ||
|
|
581f19d46f | ||
|
|
536c134b85 | ||
|
|
f05ec7f5ce | ||
|
|
75097cfe73 | ||
|
|
dc6221f14f | ||
|
|
a22420adc5 | ||
|
|
a551819af3 | ||
|
|
8ed8dc5986 | ||
|
|
e13a994092 | ||
|
|
e0428915a0 |
No files matched your search
@@ -0,0 +1,33 @@
|
||||
module.exports = {
|
||||
extends: [
|
||||
'eslint:recommended',
|
||||
'plugin:@typescript-eslint/eslint-recommended',
|
||||
'plugin:@typescript-eslint/recommended',
|
||||
'prettier/@typescript-eslint',
|
||||
'plugin:prettier/recommended',
|
||||
],
|
||||
parser: '@typescript-eslint/parser',
|
||||
plugins: ['@typescript-eslint', 'prettier', 'json'],
|
||||
parserOptions: {
|
||||
sourceType: 'module',
|
||||
},
|
||||
env: {
|
||||
es2020: true,
|
||||
node: true,
|
||||
},
|
||||
rules: {
|
||||
'prettier/prettier': 'error',
|
||||
'sort-imports': 'error',
|
||||
},
|
||||
ignorePatterns: [
|
||||
'.git/',
|
||||
'.vscode',
|
||||
'build/',
|
||||
'dist/',
|
||||
'coverage/',
|
||||
'LICENSE.md',
|
||||
'modules/',
|
||||
'node_modules/',
|
||||
'!.*',
|
||||
],
|
||||
};
|
||||
@@ -1,60 +0,0 @@
|
||||
name: 'Setup Node.js'
|
||||
description: 'Setup Node and install dependencies using cache'
|
||||
inputs:
|
||||
save-cache:
|
||||
description: 'Save cache when needed'
|
||||
required: false
|
||||
default: 'false'
|
||||
|
||||
runs:
|
||||
using: 'composite'
|
||||
|
||||
steps:
|
||||
- name: ⚙️ Calculate `CACHE_KEY`
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'CACHE_KEY=node_modules-${{
|
||||
hashFiles('.node-version', 'pnpm-lock.yaml')
|
||||
}}' >> "$GITHUB_ENV"
|
||||
|
||||
- name: ♻️ Restore `node_modules`
|
||||
uses: actions/cache/restore@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
id: node-modules-restore
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ env.CACHE_KEY }}
|
||||
enableCrossOsArchive: true
|
||||
|
||||
- name: Calculate `CACHE_HIT`
|
||||
shell: bash
|
||||
run: |
|
||||
echo 'CACHE_HIT=${{
|
||||
(steps.node-modules-restore.outputs.cache-hit == 'true') && 'true' || ''
|
||||
}}' >> "$GITHUB_ENV"
|
||||
|
||||
- name: ⚙️ Setup pnpm
|
||||
uses: pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115 # v6.1.1
|
||||
with:
|
||||
standalone: true
|
||||
|
||||
- name: ⚙️ Setup Node.js ${{ inputs.node-version }}
|
||||
uses: actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce # v7.2.0
|
||||
with:
|
||||
node-version-file: .node-version
|
||||
cache: ${{ env.CACHE_HIT != 'true' && 'pnpm' || '' }}
|
||||
|
||||
- name: 📥 Install dependencies
|
||||
if: env.CACHE_HIT != 'true'
|
||||
shell: bash
|
||||
run: pnpm install --frozen-lockfile
|
||||
env:
|
||||
# Other environment variables
|
||||
HUSKY: '0' # By default do not run HUSKY install
|
||||
|
||||
- name: ♻️ Write `node_modules` cache
|
||||
if: inputs.save-cache == 'true' && env.CACHE_HIT != 'true'
|
||||
uses: actions/cache/save@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
|
||||
with:
|
||||
path: node_modules
|
||||
key: ${{ env.CACHE_KEY }}
|
||||
enableCrossOsArchive: true
|
||||
+14
-60
@@ -1,70 +1,24 @@
|
||||
{
|
||||
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
|
||||
"extends": ["github>renovatebot/.github", ":pinDependencies"],
|
||||
"extends": ["github>renovatebot/presets-internal:node", ":pinDependencies"],
|
||||
"major": {
|
||||
"stabilityDays": 3
|
||||
},
|
||||
"packageRules": [
|
||||
{
|
||||
"description": "Use build semantic type for some deps",
|
||||
"matchPackageNames": ["@vercel/ncc", "typescript"],
|
||||
"semanticCommitType": "build"
|
||||
},
|
||||
{
|
||||
"description": "Use `build` semantic commit scope for lockfile maintenance",
|
||||
"matchUpdateTypes": ["lockFileMaintenance"],
|
||||
"semanticCommitType": "build"
|
||||
},
|
||||
{
|
||||
"description": "Use ci semantic type for some deps",
|
||||
"matchFileNames": [".github/workflows/**"],
|
||||
"semanticCommitType": "ci"
|
||||
},
|
||||
{
|
||||
"description": "Don't require approval for renovate",
|
||||
"matchPackageNames": ["ghcr.io/renovatebot/renovate", "renovatebot/github-action"],
|
||||
"dependencyDashboardApproval": false
|
||||
},
|
||||
{
|
||||
"description": "Don't pin renovate updates",
|
||||
"matchPackageNames": ["ghcr.io/renovatebot/renovate"],
|
||||
"pinDigests": false
|
||||
},
|
||||
{
|
||||
"description": "Use feat! semantic type for renovate major",
|
||||
"matchPackageNames": ["ghcr.io/renovatebot/renovate"],
|
||||
"matchUpdateTypes": ["major"],
|
||||
"commitMessagePrefix": "feat(deps)!:",
|
||||
"additionalBranchPrefix": "renovate-major"
|
||||
"description": "Automerge Renovate updates",
|
||||
"packageNames": ["renovate/renovate"],
|
||||
"updateTypes": ["major", "minor", "patch"],
|
||||
"semanticCommitType": "fix"
|
||||
}
|
||||
],
|
||||
"customManagers": [
|
||||
"regexManagers": [
|
||||
{
|
||||
"customType": "regex",
|
||||
"managerFilePatterns": ["README.md"],
|
||||
"matchStrings": ["uses: renovatebot/github-action@(?<currentValue>[^\\s]+)"],
|
||||
"depNameTemplate": "renovatebot/github-action",
|
||||
"datasourceTemplate": "github-releases"
|
||||
},
|
||||
{
|
||||
"customType": "regex",
|
||||
"managerFilePatterns": ["README.md"],
|
||||
"matchStrings": ["renovate-version: (?<currentValue>[^\\s]+)"],
|
||||
"depNameTemplate": "ghcr.io/renovatebot/renovate",
|
||||
"datasourceTemplate": "docker"
|
||||
},
|
||||
{
|
||||
"description": "Update renovate version in action.yml",
|
||||
"customType": "regex",
|
||||
"managerFilePatterns": ["action.yml"],
|
||||
"matchStrings": ["default: '(?<currentValue>[^\\s]+)' # renovate"],
|
||||
"depNameTemplate": "ghcr.io/renovatebot/renovate",
|
||||
"datasourceTemplate": "docker"
|
||||
},
|
||||
{
|
||||
"description": "Update renovate version in src/docker.ts",
|
||||
"customType": "regex",
|
||||
"managerFilePatterns": ["src/docker.ts"],
|
||||
"matchStrings": ["version = '(?<currentValue>[^\\s]+)'; // renovate"],
|
||||
"depNameTemplate": "ghcr.io/renovatebot/renovate",
|
||||
"datasourceTemplate": "docker"
|
||||
"fileMatch": ["^src/docker\\.ts$"],
|
||||
"matchStrings": [
|
||||
"// renovate: datasource=(?<datasource>[a-z-]+?) depName=(?<depName>.+?)(?: versioning=(?<versioning>[a-z-]+?))?\\s+readonly\\s+tag\\s+=\\s+'(?<currentValue>.+?)';"
|
||||
],
|
||||
"versioningTemplate": "{{#if versioning}}{{versioning}}{{else}}semver{{/if}}"
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -1,50 +0,0 @@
|
||||
# This file is machine-generated by `gh actions-lock`.
|
||||
# Do not edit by hand; run `gh actions-lock` to update.
|
||||
# Docs: https://gh.io/actions-lockfile
|
||||
version: 'v0.0.3'
|
||||
workflows:
|
||||
'.github/workflows/build.yml':
|
||||
- 'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
|
||||
- 'actions/checkout@v7.0.1'
|
||||
- 'actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce'
|
||||
- 'pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115'
|
||||
- 'wagoid/commitlint-github-action@v6.2.1'
|
||||
- 'zizmorcore/zizmor-action@v0.9.2'
|
||||
dependencies:
|
||||
'actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9':
|
||||
ref: 'v6.1.0'
|
||||
commit: 'sha1-55cc8345863c7cc4c66a329aec7e433d2d1c52a9'
|
||||
owner_id: 44036562
|
||||
repo_id: 215566462
|
||||
'actions/checkout@v7.0.1':
|
||||
ref: 'v7.0.1'
|
||||
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
|
||||
owner_id: 44036562
|
||||
repo_id: 197814629
|
||||
'actions/setup-node@8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce':
|
||||
ref: 'v7.2.0'
|
||||
commit: 'sha1-8fccf151e3ba8038c300f83b40c8fd1e94f9c5ce'
|
||||
owner_id: 44036562
|
||||
repo_id: 189476904
|
||||
'github/codeql-action@33d7b85da1a04171e211befe2c739303b9a4c066':
|
||||
ref: 'v4.39.3'
|
||||
commit: 'sha1-33d7b85da1a04171e211befe2c739303b9a4c066'
|
||||
owner_id: 9919
|
||||
repo_id: 259445878
|
||||
'pnpm/action-setup@73e46992e05b19abd31f2f3c20e0e7370d762115':
|
||||
ref: 'v6.1.1'
|
||||
commit: 'sha1-73e46992e05b19abd31f2f3c20e0e7370d762115'
|
||||
owner_id: 21320719
|
||||
repo_id: 262289747
|
||||
'wagoid/commitlint-github-action@v6.2.1':
|
||||
ref: 'v6.2.1'
|
||||
commit: 'sha1-b948419dd99f3fd78a6548d48f94e3df7f6bf3ed'
|
||||
owner_id: 7467450
|
||||
repo_id: 212203144
|
||||
'zizmorcore/zizmor-action@v0.9.2':
|
||||
ref: 'v0.9.2'
|
||||
commit: 'sha1-1b4550e929643b8b26a62303c6bd64814271a4f1'
|
||||
owner_id: 210636713
|
||||
repo_id: 985558803
|
||||
uses:
|
||||
- 'github/codeql-action@33d7b85da1a04171e211befe2c739303b9a4c066'
|
||||
+69
-171
@@ -2,217 +2,115 @@ name: Build
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
- 'renovate/**'
|
||||
|
||||
pull_request:
|
||||
workflow_dispatch:
|
||||
|
||||
concurrency:
|
||||
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
|
||||
cancel-in-progress: true
|
||||
|
||||
env:
|
||||
RENOVATE_VERSION: 45.16.0 # renovate: datasource=docker depName=ghcr.io/renovatebot/renovate
|
||||
|
||||
jobs:
|
||||
prepare:
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
show-progress: false
|
||||
|
||||
- name: 📥 Setup Node.js
|
||||
uses: $/.github/actions/setup-node
|
||||
with:
|
||||
save-cache: true
|
||||
|
||||
commitlint:
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
uses: actions/checkout@v2.3.4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
show-progress: false
|
||||
filter: blob:none # we don't need all blobs, only the full tree
|
||||
|
||||
- name: Lint commit messages
|
||||
uses: wagoid/commitlint-github-action@v6.2.1
|
||||
continue-on-error: true
|
||||
uses: wagoid/commitlint-github-action@v2.1.4
|
||||
|
||||
lint:
|
||||
needs:
|
||||
- prepare
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v1.4.4
|
||||
with:
|
||||
persist-credentials: false
|
||||
show-progress: false
|
||||
|
||||
- name: 📥 Setup Node.js
|
||||
uses: $/.github/actions/setup-node
|
||||
|
||||
node-version: '12.x'
|
||||
- name: Install project
|
||||
run: npm ci
|
||||
- name: Lint
|
||||
run: pnpm lint
|
||||
|
||||
lint-actions:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
security-events: write
|
||||
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
show-progress: false
|
||||
|
||||
- name: Run zizmor
|
||||
uses: zizmorcore/zizmor-action@v0.9.2
|
||||
with:
|
||||
version: 1.33.1
|
||||
run: npm run lint
|
||||
|
||||
e2e:
|
||||
needs:
|
||||
- prepare
|
||||
runs-on: ubuntu-latest
|
||||
if: ${{ github.event_name != 'pull_request' || github.repository_owner != github.event.pull_request.head.repo.owner.login }}
|
||||
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
configurationFile:
|
||||
- example/renovate-config.js
|
||||
- example/renovate-config.json
|
||||
configurationFile: [example/renovate-config.js, example/renovate.json]
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
show-progress: false
|
||||
|
||||
- name: 📥 Setup Node.js
|
||||
uses: $/.github/actions/setup-node
|
||||
|
||||
uses: actions/checkout@v2.3.4
|
||||
- name: Install project
|
||||
run: npm ci
|
||||
- name: Build
|
||||
run: pnpm build
|
||||
|
||||
- name: Configure renovate token
|
||||
run: |
|
||||
if [[ "${RENOVATE_TOKEN}" != "" ]]; then
|
||||
echo "RENOVATE_TOKEN=${RENOVATE_TOKEN}" >> $GITHUB_ENV
|
||||
else
|
||||
echo "RENOVATE_TOKEN=${GITHUB_TOKEN}" >> $GITHUB_ENV
|
||||
fi
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
|
||||
|
||||
run: npm run build
|
||||
- name: Renovate test
|
||||
uses: ./ # zizmor: ignore[self-repository] tests the action built in the workspace
|
||||
env:
|
||||
LOG_LEVEL: debug
|
||||
uses: ./
|
||||
with:
|
||||
configurationFile: ${{ matrix.configurationFile }}
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
|
||||
- name: Renovate test with entrypoint
|
||||
uses: ./ # zizmor: ignore[self-repository] tests the action built in the workspace
|
||||
env:
|
||||
LOG_LEVEL: debug
|
||||
with:
|
||||
configurationFile: ${{ matrix.configurationFile }}
|
||||
renovate-version: ${{ env.RENOVATE_VERSION }}
|
||||
docker-cmd-file: example/entrypoint.sh
|
||||
docker-user: root
|
||||
|
||||
- name: Renovate test with image and digest
|
||||
uses: ./ # zizmor: ignore[self-repository] tests the action built in the workspace
|
||||
env:
|
||||
LOG_LEVEL: debug
|
||||
with:
|
||||
configurationFile: ${{ matrix.configurationFile }}
|
||||
renovate-image: ghcr.io/renovatebot/renovate:44.115.4@sha256:03e987bec9fbda0cf39ef63f2d293e821d96525119e1ab3d0ff87d5b3ef3edd9
|
||||
|
||||
renovate-config-validator:
|
||||
build:
|
||||
needs: [lint, commitlint, e2e]
|
||||
runs-on: ubuntu-latest
|
||||
timeout-minutes: 10
|
||||
container:
|
||||
image: ghcr.io/renovatebot/renovate:45.16.0@sha256:125f2e3b20e406e7c3393b56b48f6883ed3d4dc8a1bec50c43326a21da932769
|
||||
# github hosted runners are running as `1001:127` (ubuntu:docker)
|
||||
options: -u 1001:0 --group-add 1000 --group-add 12021 --group-add 127
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
with:
|
||||
persist-credentials: false
|
||||
show-progress: false
|
||||
|
||||
- name: Validate Renovate configuration
|
||||
working-directory: example
|
||||
run: |
|
||||
renovate-config-validator renovate-config.js renovate-config.json
|
||||
- run: echo 'dummy'
|
||||
|
||||
release:
|
||||
needs:
|
||||
- lint
|
||||
- commitlint
|
||||
- lint-actions
|
||||
- e2e
|
||||
- renovate-config-validator
|
||||
needs: [build]
|
||||
runs-on: ubuntu-latest
|
||||
if: |
|
||||
startsWith(github.event.commits[0].message,
|
||||
'fix(deps): update renovate/renovate docker tag ')
|
||||
&& github.ref == 'refs/heads/master'
|
||||
steps:
|
||||
- name: Setup Git user
|
||||
shell: bash
|
||||
run: |
|
||||
git config --global core.autocrlf false
|
||||
git config --global core.symlinks true
|
||||
git config --global user.name "github-actions[bot]"
|
||||
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1 # zizmor: ignore[artipacked] pushes the release branch
|
||||
uses: actions/checkout@v2.3.4
|
||||
with:
|
||||
fetch-depth: 0 # required for semantic release
|
||||
fetch-depth: 0
|
||||
ref: 'release'
|
||||
show-progress: false
|
||||
filter: blob:none # we don't need all blobs, only the full tree
|
||||
|
||||
- name: fetch pr
|
||||
if: ${{github.event_name == 'pull_request'}}
|
||||
run: git fetch origin +$GH_SHA:$GH_REF
|
||||
env:
|
||||
GH_SHA: ${{ github.sha }}
|
||||
GH_REF: ${{ github.ref }}
|
||||
|
||||
- name: Merge main
|
||||
id: merge
|
||||
- name: Fetch tags
|
||||
run: git fetch --tags
|
||||
- name: Setup Git user
|
||||
run: |
|
||||
git merge --no-ff -Xtheirs -m "skip: merge ($GH_SHA) [skip release]" $GH_SHA
|
||||
commit=$(git rev-parse HEAD)
|
||||
env:
|
||||
GH_SHA: ${{ github.sha }}
|
||||
|
||||
- name: 📥 Setup Node.js
|
||||
uses: $/.github/actions/setup-node
|
||||
|
||||
- name: Push release branch
|
||||
run: git push origin release:release
|
||||
if: ${{ github.ref_name == github.event.repository.default_branch }}
|
||||
|
||||
git config --local user.name "github-actions[bot]"
|
||||
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
|
||||
- name: Merge master
|
||||
run: |
|
||||
git merge -m 'chore(release): merge master (${{ github.sha }})' ${{ github.sha }}
|
||||
- name: Setup node
|
||||
uses: actions/setup-node@v1.4.4
|
||||
with:
|
||||
node-version: '12.x'
|
||||
- name: Install project
|
||||
run: npm ci --ignore-scripts
|
||||
- name: Get version
|
||||
id: release
|
||||
run: npm run release:version
|
||||
- name: Release
|
||||
run: npm run release -- "${{ steps.release.outputs.version }}"
|
||||
- name: Get changelog section
|
||||
id: changelog
|
||||
run: |
|
||||
# override for semantic-release
|
||||
export GITHUB_REF=refs/heads/release GITHUB_SHA=${{ steps.merge.outputs.commit }}
|
||||
pnpm release
|
||||
if: ${{ github.ref_name == github.event.repository.default_branch }}
|
||||
changelog="$(git show --unified=0 CHANGELOG.md \
|
||||
| tail +12 \
|
||||
| sed -e 's/^\+//' \
|
||||
| sed -z 's/\n/%0A/g;s/\r/%0D/g')"
|
||||
echo "::set-output name=changelog::${changelog}"
|
||||
- name: Publish release
|
||||
run: git push --follow-tags
|
||||
- name: Publish GitHub release
|
||||
uses: actions/create-release@v1.1.4
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ github.token }}
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
with:
|
||||
tag_name: v${{ steps.release.outputs.version }}
|
||||
release_name: v${{ steps.release.outputs.version }}
|
||||
body: |
|
||||
*See the the [changelog](
|
||||
https://github.com/${{ github.repository }}/blob/release/CHANGELOG.md
|
||||
) for changes in all releases.*
|
||||
|
||||
${{ steps.changelog.outputs.changelog }}
|
||||
+1
-4
@@ -187,7 +187,7 @@ typings/
|
||||
# nuxt.js build output
|
||||
.nuxt
|
||||
|
||||
# react / gatsby
|
||||
# react / gatsby
|
||||
public/
|
||||
|
||||
# vuepress build output
|
||||
@@ -300,6 +300,3 @@ dkms.conf
|
||||
*.exe
|
||||
*.out
|
||||
*.app
|
||||
|
||||
|
||||
/.pnpm-store
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
commitlint --edit "$1"
|
||||
@@ -1,3 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
lint-staged
|
||||
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
hooks: {
|
||||
'pre-commit': 'lint-staged',
|
||||
'commit-msg': 'commitlint -E HUSKY_GIT_PARAMS',
|
||||
},
|
||||
};
|
||||
@@ -0,0 +1,6 @@
|
||||
module.exports = {
|
||||
'*.{ts,tsx,js,jsx,json}': ['npm run lint-es:file:fix'],
|
||||
'*.{vue,ts,css,less,scss,html,htm,md,markdown,yml,yaml}': [
|
||||
'npm run format:file',
|
||||
],
|
||||
};
|
||||
@@ -1,4 +0,0 @@
|
||||
{
|
||||
"*.{js,ts,cjs,mjs}": ["oxlint --fix", "oxfmt"],
|
||||
"!*.{js,ts,cjs,mjs}": "oxfmt --no-error-on-unmatched-pattern"
|
||||
}
|
||||
@@ -1 +0,0 @@
|
||||
24.23.0
|
||||
@@ -1,6 +0,0 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxfmt/configuration_schema.json",
|
||||
"singleQuote": true,
|
||||
"sortPackageJson": {},
|
||||
"ignorePatterns": ["LICENSE.md", "pnpm-lock.yaml"]
|
||||
}
|
||||
-102
@@ -1,102 +0,0 @@
|
||||
{
|
||||
"$schema": "./node_modules/oxlint/configuration_schema.json",
|
||||
"plugins": ["eslint", "typescript", "import", "vitest", "promise", "oxc"],
|
||||
"jsPlugins": ["@containerbase/oxlint-plugin"],
|
||||
"options": {
|
||||
"typeAware": true,
|
||||
"reportUnusedDisableDirectives": "error"
|
||||
},
|
||||
"categories": {
|
||||
"correctness": "error"
|
||||
},
|
||||
"env": {
|
||||
"builtin": true,
|
||||
"node": true
|
||||
},
|
||||
"ignorePatterns": ["dist/", "coverage/", ".claude/worktrees/", ".pnpm-store"],
|
||||
"rules": {
|
||||
"containerbase/enforce-ts-extension": "error",
|
||||
"containerbase/no-undeclared-dependencies": "error",
|
||||
"containerbase/organize-imports": "error",
|
||||
"containerbase/test-root-describe": "error",
|
||||
|
||||
"import/no-cycle": "error",
|
||||
"import/no-duplicates": "error",
|
||||
"import/export": "error",
|
||||
|
||||
"curly": ["error", "all"],
|
||||
"no-var": "error",
|
||||
"prefer-const": "error",
|
||||
"prefer-rest-params": "error",
|
||||
"prefer-spread": "error",
|
||||
"no-empty": "error",
|
||||
"no-prototype-builtins": "error",
|
||||
"no-useless-escape": "error",
|
||||
"no-fallthrough": "error",
|
||||
"no-unused-vars": ["error", { "varsIgnorePattern": "^_", "argsIgnorePattern": "^_" }],
|
||||
"no-unused-expressions": "error",
|
||||
"no-empty-function": "error",
|
||||
"no-array-constructor": "error",
|
||||
|
||||
"sort-imports": [
|
||||
"error",
|
||||
{
|
||||
"ignoreCase": false,
|
||||
"ignoreDeclarationSort": true,
|
||||
"ignoreMemberSort": false,
|
||||
"memberSyntaxSortOrder": ["none", "all", "multiple", "single"]
|
||||
}
|
||||
],
|
||||
|
||||
"typescript/unbound-method": ["error", { "ignoreStatic": true }],
|
||||
"typescript/restrict-plus-operands": "error",
|
||||
"typescript/restrict-template-expressions": "error",
|
||||
"typescript/no-empty-object-type": "error",
|
||||
"typescript/ban-ts-comment": "error",
|
||||
"typescript/no-explicit-any": "error",
|
||||
"typescript/no-namespace": "error",
|
||||
"typescript/no-non-null-assertion": "error",
|
||||
"typescript/no-require-imports": "error",
|
||||
"typescript/no-unsafe-argument": "error",
|
||||
"typescript/no-unsafe-assignment": "error",
|
||||
"typescript/no-unsafe-call": "error",
|
||||
"typescript/no-unsafe-member-access": "error",
|
||||
"typescript/no-unsafe-return": "error",
|
||||
"typescript/no-unsafe-function-type": "error",
|
||||
"typescript/no-wrapper-object-types": "error",
|
||||
"typescript/only-throw-error": "error",
|
||||
"typescript/prefer-promise-reject-errors": "error",
|
||||
"typescript/require-await": "error",
|
||||
"typescript/triple-slash-reference": "error",
|
||||
"typescript/no-unsafe-enum-comparison": "error",
|
||||
"typescript/no-unnecessary-type-assertion": "error",
|
||||
"typescript/no-redundant-type-constituents": "error",
|
||||
"typescript/no-duplicate-type-constituents": "error",
|
||||
"typescript/no-base-to-string": "error",
|
||||
"typescript/no-misused-promises": "error",
|
||||
"typescript/no-floating-promises": "error",
|
||||
"typescript/await-thenable": "error",
|
||||
"typescript/no-for-in-array": "error",
|
||||
"typescript/no-implied-eval": "error",
|
||||
"typescript/no-array-delete": "error",
|
||||
"typescript/no-this-alias": "error",
|
||||
|
||||
"promise/always-return": "error",
|
||||
"promise/catch-or-return": "error",
|
||||
"promise/no-return-wrap": "error",
|
||||
"promise/param-names": "error",
|
||||
"promise/valid-params": "error",
|
||||
|
||||
"vitest/require-mock-type-parameters": "off",
|
||||
"vitest/require-to-throw-message": "off"
|
||||
},
|
||||
"overrides": [
|
||||
{
|
||||
"files": ["tools/**", "commitlint.config.js"],
|
||||
"rules": {
|
||||
"containerbase/no-undeclared-dependencies": ["error", { "allowDevDependencies": true }],
|
||||
"typescript/no-explicit-any": "off"
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
.git/
|
||||
.vscode
|
||||
build/
|
||||
dist/
|
||||
coverage/
|
||||
LICENSE.md
|
||||
modules/
|
||||
node_modules/
|
||||
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
singleQuote: true,
|
||||
};
|
||||
@@ -1,96 +0,0 @@
|
||||
{
|
||||
"branches": ["release"],
|
||||
"plugins": [
|
||||
"@semantic-release/commit-analyzer",
|
||||
"@semantic-release/release-notes-generator",
|
||||
"@semantic-release/npm",
|
||||
[
|
||||
"@semantic-release/git",
|
||||
{
|
||||
"assets": ["dist", "package.json"],
|
||||
"message": "chore(release): ${nextRelease.version} [skip ci]"
|
||||
}
|
||||
],
|
||||
[
|
||||
"@semantic-release/github",
|
||||
{
|
||||
"releasedLabels": false,
|
||||
"successComment": false
|
||||
}
|
||||
]
|
||||
],
|
||||
"analyzeCommits": {
|
||||
"releaseRules": [
|
||||
{
|
||||
"type": "docs",
|
||||
"scope": "readme.md",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "build",
|
||||
"release": "patch"
|
||||
},
|
||||
{
|
||||
"type": "skip",
|
||||
"release": false
|
||||
}
|
||||
]
|
||||
},
|
||||
"preset": "conventionalcommits",
|
||||
"presetConfig": {
|
||||
"types": [
|
||||
{
|
||||
"type": "feat",
|
||||
"section": "Features"
|
||||
},
|
||||
{
|
||||
"type": "feature",
|
||||
"section": "Features"
|
||||
},
|
||||
{
|
||||
"type": "fix",
|
||||
"section": "Bug Fixes"
|
||||
},
|
||||
{
|
||||
"type": "perf",
|
||||
"section": "Performance Improvements"
|
||||
},
|
||||
{
|
||||
"type": "revert",
|
||||
"section": "Reverts"
|
||||
},
|
||||
{
|
||||
"type": "docs",
|
||||
"section": "Documentation"
|
||||
},
|
||||
{
|
||||
"type": "style",
|
||||
"section": "Styles"
|
||||
},
|
||||
{
|
||||
"type": "chore",
|
||||
"section": "Miscellaneous Chores"
|
||||
},
|
||||
{
|
||||
"type": "refactor",
|
||||
"section": "Code Refactoring"
|
||||
},
|
||||
{
|
||||
"type": "test",
|
||||
"section": "Tests"
|
||||
},
|
||||
{
|
||||
"type": "build",
|
||||
"section": "Build System"
|
||||
},
|
||||
{
|
||||
"type": "ci",
|
||||
"section": "Continuous Integration"
|
||||
},
|
||||
{
|
||||
"type": "skip",
|
||||
"hidden": true
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
module.exports = {
|
||||
scripts: {
|
||||
prerelease:
|
||||
'if [ "$(git branch --show-current)" != "release" ]; then exit 1; fi',
|
||||
},
|
||||
commitAll: true,
|
||||
};
|
||||
+1611
-1
File diff suppressed because it is too large.
Load diff
@@ -2,300 +2,57 @@
|
||||
|
||||
GitHub Action to run Renovate self-hosted.
|
||||
|
||||
<!-- markdownlint-disable no-inline-html -->
|
||||
|
||||
<a name="toc"></a>
|
||||
|
||||
## Table of contents
|
||||
|
||||
- [Badges](#badges)
|
||||
- [Options](#options)
|
||||
- [`additional-env-list`](#additional-env-list)
|
||||
- [`configurationFile`](#configurationfile)
|
||||
- [`docker-cmd-file`](#docker-cmd-file)
|
||||
- [`docker-network`](#docker-network)
|
||||
- [`docker-socket-host-path`](#docker-socket-host-path)
|
||||
- [`docker-user`](#docker-user)
|
||||
- [`docker-volumes`](#docker-volumes)
|
||||
- [`env-regex`](#env-regex)
|
||||
- [`mount-docker-socket`](#mount-docker-socket)
|
||||
- [`token`](#token)
|
||||
- [`renovate-image`](#renovate-image)
|
||||
- [`renovate-version`](#renovate-version)
|
||||
- [Example](#example)
|
||||
- [Environment Variables](#environment-variables)
|
||||
- [Passing other environment variables](#passing-other-environment-variables)
|
||||
- [Persisting the Repository Cache](#persisting-the-repository-cache)
|
||||
- [Troubleshooting](#troubleshooting)
|
||||
- [Debug Logging](#debug-logging)
|
||||
- [Special token requirements when using the `github-actions` manager](#special-token-requirements-when-using-the-github-actions-manager)
|
||||
- [License](#license)
|
||||
|
||||
## Badges
|
||||
|
||||
| Badge | Description | Service |
|
||||
| ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------- |
|
||||
| <a href="https://github.com/prettier/prettier#readme"><img alt="code style" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a> | Code style | Prettier |
|
||||
| <a href="https://conventionalcommits.org"><img alt="Conventional Commits: 1.0.0" src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square"></a> | Commit style | Conventional Commits |
|
||||
| <a href="https://renovatebot.com"><img alt="Renovate enabled" src="https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square"></a> | Dependencies | Renovate |
|
||||
| <a href="https://github.com/renovatebot/github-action/actions"><img alt="GitHub workflow status" src="https://img.shields.io/github/actions/workflow/status/renovatebot/github-action/build.yml?style=flat-square"></a> | Build | GitHub Actions |
|
||||
| Badge | Description | Service |
|
||||
| ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | ------------ | -------------------- |
|
||||
| <a href="https://github.com/prettier/prettier#readme"><img alt="code style" src="https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square"></a> | Code style | Prettier |
|
||||
| <a href="https://conventionalcommits.org"><img alt="Conventional Commits: 1.0.0" src="https://img.shields.io/badge/Conventional%20Commits-1.0.0-yellow.svg?style=flat-square"></a> | Commit style | Conventional Commits |
|
||||
| <a href="https://renovatebot.com"><img alt="Renovate enabled" src="https://img.shields.io/badge/renovate-enabled-brightgreen.svg?style=flat-square"></a> | Dependencies | Renovate |
|
||||
| <a href="https://github.com/renovatebot/github-action/actions"><img alt="GitHub workflow status" src="https://img.shields.io/github/workflow/status/renovatebot/github-action/Build?style=flat-square"></a> | Build | GitHub Actions |
|
||||
| <a href="https://github.com/renovatebot/github-action/actions"><img alt="GitHub workflow status" src="https://img.shields.io/github/workflow/status/renovatebot/github-action/Example?style=flat-square"></a> | Example | GitHub Actions |
|
||||
|
||||
## Options
|
||||
|
||||
Options can be passed using the inputs of this action or the corresponding environment variables.
|
||||
When both are passed, the input takes precedence over the environment variable.
|
||||
For the available environment variables, see the Renovate [Self-Hosted Configuration](https://docs.renovatebot.com/self-hosted-configuration/) docs.
|
||||
## `configurationFile`
|
||||
|
||||
### `additional-env-list`
|
||||
Configuration file to configure Renovate. The supported configurations files can be one of the configuration files listed in the Renovate Docs for [Configuration Options](https://docs.renovatebot.com/configuration-options/) or a JavaScript file that exports a configuration object. For both of these options, an example can be found in the [example](./example) directory.
|
||||
|
||||
A newline-separated list of environment variable names to pass through to the Renovate container, in addition to those already matched by [`env-regex`](#env-regex).
|
||||
See [Passing other environment variables](#passing-other-environment-variables) section for more details.
|
||||
|
||||
### `configurationFile`
|
||||
|
||||
Configuration file to configure Renovate ("global" config) in JavaScript or JSON format.
|
||||
It is recommended to not name it one of the repository configuration filenames listed in the Renovate Docs for [Configuration Options](https://docs.renovatebot.com/configuration-options/).
|
||||
|
||||
Config examples can be found in the [example](./example) directory.
|
||||
|
||||
The configurations that can be done in this file consists of two parts, as listed below.
|
||||
Refer to the links to the [Renovate Docs](https://docs.renovatebot.com/) for all options.
|
||||
The configurations that can be done in this file consists of two parts, as listed below. Refer to the links to the [Renovate Docs](https://docs.renovatebot.com/) for all options.
|
||||
|
||||
1. [Self-Hosted Configuration Options](https://docs.renovatebot.com/self-hosted-configuration/)
|
||||
2. [Configuration Options](https://docs.renovatebot.com/configuration-options/)
|
||||
|
||||
The [`branchPrefix`](https://docs.renovatebot.com/configuration-options/#branchprefix) option is important to configure and should be configured to a value other than the default to prevent interference with e.g. the Renovate GitHub App.
|
||||
|
||||
If you want to use this with just the single configuration file, make sure to include the following two configuration lines.
|
||||
This disables the requirement of a configuration file for the repository and disables onboarding.
|
||||
If you want to use this with just the single configuration file, make sure to include the following two configuration lines. This disables the requirement of a configuration file for the repository and disables onboarding.
|
||||
|
||||
```js
|
||||
onboarding: false,
|
||||
requireConfig: 'optional',
|
||||
requireConfig: false,
|
||||
```
|
||||
|
||||
### `docker-cmd-file`
|
||||
## `token`
|
||||
|
||||
Specify a command to run when the image start.
|
||||
By default the image run
|
||||
`renovate`.
|
||||
This option is useful to customize the image before running `renovate`.
|
||||
It must be an existing executable file on the local system.
|
||||
It will be mounted to the docker container.
|
||||
[Generate a personal access token](https://github.com/settings/tokens), with the `repo:public_repo` scope for only public repositories or the `repo` scope for public and private repositories, and add it to _Secrets_ (repository settings) as `RENOVATE_TOKEN`. You can also create a token without a specific scope, which gives read-only access to public repositories, for testing. This token is only used by Renovate, see the [token configuration](https://docs.renovatebot.com/self-hosted-configuration/#token), and gives it access to the repositories. The name of the secret can be anything as long as it matches the argument given to the `token` option.
|
||||
|
||||
For example you can create a simple script like this one (let's call it
|
||||
`renovate-entrypoint.sh`).
|
||||
|
||||
```sh
|
||||
#!/bin/bash
|
||||
|
||||
apt update
|
||||
|
||||
apt install -y build-essential libpq-dev
|
||||
|
||||
runuser -u ubuntu renovate
|
||||
```
|
||||
|
||||
Now use this action
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
docker-cmd-file: .github/renovate-entrypoint.sh
|
||||
docker-user: root
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
```
|
||||
|
||||
### `docker-network`
|
||||
|
||||
Specify a network to run container in.
|
||||
|
||||
You can use `${{ job.container.network }}` to run renovate container [in the same network as other containers for this job](https://docs.github.com/en/actions/learn-github-actions/contexts#job-context),
|
||||
or set it to `host` to run in the same network as github runner, or specify any custom network.
|
||||
|
||||
### `docker-socket-host-path`
|
||||
|
||||
Allows the overriding of the host path for the Docker socket that is mounted into the container.
|
||||
Useful on systems where the host Docker socket is located somewhere other than `/var/run/docker.sock` (the default).
|
||||
Only applicable when `mount-docker-socket` is true.
|
||||
|
||||
### `docker-user`
|
||||
|
||||
Specify a user (or user-id) to run docker command.
|
||||
|
||||
You can use it with [`docker-cmd-file`](#docker-cmd-file) in order to start the
|
||||
image as root, do some customization and switch back to a unprivileged user.
|
||||
|
||||
### `docker-volumes`
|
||||
|
||||
Specify volume mounts. Defaults to `/tmp:/tmp`.
|
||||
The volume mounts are separated through `;`.
|
||||
|
||||
This sample will mount `/tmp:/tmp` and `/foo:/bar`.
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
docker-volumes: |
|
||||
/tmp:/tmp ;
|
||||
/foo:/bar
|
||||
```
|
||||
|
||||
### `env-regex`
|
||||
|
||||
Allows to configure the regex to define which environment variables are passed to the renovate container.
|
||||
See [Passing other environment variables](#passing-other-environment-variables) section for more details.
|
||||
|
||||
## `mount-docker-socket`
|
||||
|
||||
Default to `false`. If set to `true` the action will mount the Docker socket
|
||||
inside the renovate container so that the commands can use Docker. Can be useful
|
||||
for `postUpgradeTasks`'s commands. Also add the user inside the renovate
|
||||
container to the docker group for socket permissions.
|
||||
|
||||
### `token`
|
||||
|
||||
[Generate a Personal Access Token (classic)](https://github.com/settings/tokens), with the `repo:public_repo` scope for only public repositories or the `repo` scope for public and private repositories, and add it to _Secrets_ (repository settings) as `RENOVATE_TOKEN`.
|
||||
You can also create a token without a specific scope, which gives read-only access to public repositories, for testing.
|
||||
This token is only used by Renovate, see the [token configuration](https://docs.renovatebot.com/self-hosted-configuration/#token), and gives it access to the repositories.
|
||||
The name of the secret can be anything as long as it matches the argument given to the `token` option.
|
||||
|
||||
Fine-grained Personal Access Tokens are now supported, as GitHub has [implemented GraphQL API support for them](https://github.com/github/roadmap/issues/622).
|
||||
However, some permission gaps may remain (for example, around `Checks` access), so a classic token is still the safer default if you run into authentication or automerge limitations.
|
||||
|
||||
If you want to use the `github-actions` manager, you must setup a [special token](#special-token-requirements-when-using-the-github-actions-manager) with some requirements.
|
||||
|
||||
> [!NOTE]
|
||||
> [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token)
|
||||
> can be also used; however, workflows run on RenovateBot's PRs will need to be [manually approved](https://github.blog/changelog/2026-06-11-bot-created-pull-requests-can-run-workflows-if-approved/).
|
||||
>
|
||||
> Additionally, ["Allow GitHub Actions to create and approve pull requests"](https://docs.github.com/en/repositories/managing-your-repositorys-settings-and-features/enabling-features-for-your-repository/managing-github-actions-settings-for-a-repository#preventing-github-actions-from-creating-or-approving-pull-requests)
|
||||
> needs to be enabled on the repository or organisation level.
|
||||
|
||||
### `renovate-image`
|
||||
|
||||
The Renovate Docker image name to use.
|
||||
If omitted the action will use the `ghcr.io/renovatebot/renovate:<renovate-version>` Docker image name otherwise.
|
||||
If a Docker image name is defined, the action will use that name to pull the image.
|
||||
|
||||
This sample will use `myproxyhub.domain.com/renovate/renovate:<renovate-version>` image.
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
renovate-image: myproxyhub.domain.com/renovate/renovate
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
```
|
||||
|
||||
This sample will use `ghcr.io/renovatebot/renovate:<renovate-version>` image.
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
```
|
||||
|
||||
It is also possible to specify a full Docker image pinned to a version (and optionally, a digest) like so:
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
renovate-image: ghcr.io/renovatebot/renovate@sha256:0f7ba2b70c5d1a7e2d95b0f6c3d5b4a1e2f6b6a1e2f6b6a1e2f6b6a1e2f6b6a1
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
```
|
||||
|
||||
### `renovate-version`
|
||||
|
||||
The Renovate version to use.
|
||||
If omitted the action will use the [`default version`](./action.yml#L28) Docker tag.
|
||||
Check [the available tags on Docker Hub](https://hub.docker.com/r/renovate/renovate/tags).
|
||||
|
||||
This sample will use `ghcr.io/renovatebot/renovate:45.16.0` image.
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
renovate-version: 45.16.0
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
```
|
||||
|
||||
This sample will use `ghcr.io/renovatebot/renovate:full` image.
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
renovate-version: full
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
```
|
||||
|
||||
We recommend you pin the version of Renovate to a full version or a full checksum, and use Renovate's regex manager to create PRs to update the pinned version.
|
||||
See `.github/workflows/build.yml` for an example of how to do this.
|
||||
Note that the [`GITHUB_TOKEN`](https://help.github.com/en/actions/configuring-and-managing-workflows/authenticating-with-the-github_token#permissions-for-the-github_token) secret can't be used for authenticating Renovate.
|
||||
|
||||
## Example
|
||||
|
||||
This example uses a Personal Access Token and will run every 15 minutes.
|
||||
The Personal Access token is configured as a GitHub secret named `RENOVATE_TOKEN`.
|
||||
This example uses the [`example/renovate-config.js`](./example/renovate-config.js) file as configuration.
|
||||
Live examples with more advanced configurations of this action can be found in the following repositories:
|
||||
|
||||
- [vidavidorra/renovate](https://github.com/vidavidorra/renovate/blob/main/.github/renovate.json)
|
||||
- [jenkinsci/helm-charts](https://github.com/jenkinsci/helm-charts/blob/main/.github/renovate-config.json5)
|
||||
This example uses a personal access token and will run every 15 minutes. The personal access token is configured as a GitHub secret named `RENOVATE_TOKEN`. This example uses the [`example/config.js`](./example/config.js) file as configuration.
|
||||
You can also see a live example of this action in my [github-renovate](https://github.com/vidavidorra/github-renovate) repository, which also includes a more [advanced configuration](https://github.com/vidavidorra/github-renovate/blob/master/src/config.js) for updating GitHub Action workflows.
|
||||
|
||||
**Remark** Update the action version to the most current, see [here](https://github.com/renovatebot/github-action/releases/latest) for latest release.
|
||||
|
||||
@@ -311,285 +68,10 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
uses: actions/checkout@v2.0.0
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
uses: renovatebot/github-action@v21.30.0
|
||||
with:
|
||||
configurationFile: example/renovate-config.js
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
```
|
||||
|
||||
### Example for GitHub Enterprise
|
||||
|
||||
If you want to use the Renovate Action on a GitHub Enterprise instance you have to add the following environment variable:
|
||||
|
||||
```yml
|
||||
....
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
configurationFile: example/renovate-config.js
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
env:
|
||||
RENOVATE_ENDPOINT: "https://git.your-company.com/api/v3"
|
||||
```
|
||||
|
||||
### Example with GitHub App
|
||||
|
||||
Instead of using a Personal Access Token (PAT) that is tied to a particular user you can use a [GitHub App](https://docs.github.com/en/developers/apps/building-github-apps) where permissions can be even better tuned.
|
||||
[Create a new app](https://docs.github.com/en/developers/apps/creating-a-github-app) and configure the app permissions and your `config.js` as described in the [Renovate documentation](https://docs.renovatebot.com/modules/platform/github/#running-as-a-github-app).
|
||||
|
||||
Generate and download a new private key for the app, adding the contents of the downloaded `.pem` file to _Secrets_ (repository settings) with the name `private_key` and app ID as a secret with name `app_id`.
|
||||
|
||||
Adjust your Renovate configuration file to specify the username of your bot.
|
||||
|
||||
From the Github app configuration page, install the app in your account or your organization's account, and configure the repository access.
|
||||
|
||||
Going forward we will be using the [`actions/create-github-app-token` action](https://github.com/actions/create-github-app-token) in order to exchange the GitHub App certificate for an access token that Renovate can use.
|
||||
|
||||
The final workflow will look like this:
|
||||
|
||||
```yaml
|
||||
name: Renovate
|
||||
on:
|
||||
schedule:
|
||||
# The "*" (#42, asterisk) character has special semantics in YAML, so this
|
||||
# string has to be quoted.
|
||||
- cron: '0/15 * * * *'
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Get token
|
||||
id: get_token
|
||||
uses: actions/create-github-app-token@v1
|
||||
with:
|
||||
private-key: ${{ secrets.private_key }}
|
||||
app-id: ${{ secrets.app_id }}
|
||||
owner: ${{ github.repository_owner }}
|
||||
repositories: 'repo1,repo2'
|
||||
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
configurationFile: example/renovate-config.js
|
||||
token: '${{ steps.get_token.outputs.token }}'
|
||||
```
|
||||
|
||||
### Commit signing with GitHub App
|
||||
|
||||
Renovate can sign commits when deployed as a GitHub App by utilizing GitHub's API-based commits.
|
||||
To activate this, ensure that `platformCommit` is set to `enabled` in global config.
|
||||
If a configuration file is defined, include `platformCommit: enabled` to activate this feature.
|
||||
For example:
|
||||
|
||||
```yaml
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
token: '${{ steps.get_token.outputs.token }}'
|
||||
env:
|
||||
RENOVATE_PLATFORM_COMMIT: 'enabled'
|
||||
```
|
||||
|
||||
## Environment Variables
|
||||
|
||||
Environment variables prefixed with `RENOVATE_` are passed through to the Docker container automatically. This prefix is reserved for [Renovate self-hosted configuration](https://docs.renovatebot.com/self-hosted-configuration/), so using it for unrelated credentials can accidentally conflict with a Renovate option.
|
||||
|
||||
For custom credentials, use a distinct prefix and add the variable to [`env-regex`](#passing-other-environment-variables).
|
||||
|
||||
For example if you wish to pass through some credentials for a [host rule](https://docs.renovatebot.com/configuration-options/#hostrules) to the `config.js` then you should do so like this.
|
||||
|
||||
1. In your workflow pass in the environment variable
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
configurationFile: example/renovate-config.js
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
env-regex: "^(?:RENOVATE_\\w+|LOG_LEVEL|GITHUB_COM_TOKEN|NODE_OPTIONS|NO_COLOR|(?:HTTPS?|NO)_PROXY|(?:https?|no)_proxy|CUSTOM_TFE_TOKEN)$"
|
||||
env:
|
||||
CUSTOM_TFE_TOKEN: ${{ secrets.MY_TFE_TOKEN }}
|
||||
```
|
||||
|
||||
1. In `example/renovate-config.js` include the hostRules block
|
||||
|
||||
```js
|
||||
module.exports = {
|
||||
hostRules: [
|
||||
{
|
||||
hostType: 'terraform-module',
|
||||
matchHost: 'app.terraform.io',
|
||||
token: process.env.CUSTOM_TFE_TOKEN,
|
||||
},
|
||||
],
|
||||
};
|
||||
```
|
||||
|
||||
### User agent
|
||||
|
||||
By default, the Action sets [`RENOVATE_USER_AGENT`](https://docs.renovatebot.com/self-hosted-configuration/#useragent) to `Renovate/{{renovateVersion}} (https://github.com/renovatebot/github-action)`, so that operators of registries can identify traffic coming from this Action.
|
||||
|
||||
To override it, set the `RENOVATE_USER_AGENT` environment variable on the Action step.
|
||||
|
||||
### Passing other environment variables
|
||||
|
||||
There are two ways to pass additional variables through to the Renovate container:
|
||||
|
||||
1. **Recommended:** use [`additional-env-list`](#additional-env-list) to list the names of the variables you want forwarded. This keeps the action's default `env-regex` in effect, so you'll continue to receive any future additions to the default allow-list. Variable names that are not present in the environment are silently ignored.
|
||||
2. Override [`env-regex`](#env-regex) with a custom regular expression. This gives you full control but also full ownership: if the action's default pattern changes, your override will not pick up those changes, and a typo in the regex can silently drop variables (including `RENOVATE_*` ones).
|
||||
|
||||
Example using `additional-env-list` (recommended):
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v6.1.0
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
configurationFile: example/renovate-config.js
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
additional-env-list: |
|
||||
AWS_TOKEN
|
||||
MY_OTHER_SECRET
|
||||
env:
|
||||
AWS_TOKEN: ${{ secrets.AWS_TOKEN }}
|
||||
MY_OTHER_SECRET: ${{ secrets.MY_OTHER_SECRET }}
|
||||
```
|
||||
|
||||
Example using `env-regex` (full override):
|
||||
|
||||
```yml
|
||||
....
|
||||
jobs:
|
||||
renovate:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v7.0.1
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
configurationFile: example/renovate-config.js
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
env-regex: "^(?:RENOVATE_\\w+|LOG_LEVEL|GITHUB_COM_TOKEN|NODE_OPTIONS|AWS_TOKEN)$"
|
||||
env:
|
||||
AWS_TOKEN: ${{ secrets.AWS_TOKEN }}
|
||||
```
|
||||
|
||||
## Persisting the repository cache
|
||||
|
||||
In some cases, Renovate can update PRs more frequently than you expect. The [repository cache](https://docs.renovatebot.com/self-hosted-configuration/#repositorycache) can help with this issue. You need a few things to persist this cache in GitHub Actions:
|
||||
|
||||
1. Enable the `repositoryCache` [option](https://docs.renovatebot.com/self-hosted-configuration/#repositorycache) via env vars or renovate.json.
|
||||
2. Restore `/tmp/renovate/cache/renovate/repository` before Renovate runs.
|
||||
3. Save the updated directory under a new cache key after Renovate finishes.
|
||||
|
||||
Below is a workflow example with caching.
|
||||
|
||||
The primary key includes `github.run_id` and `github.run_attempt`, so each successful run or rerun can save its updated cache. `restore-keys` selects the most recent prior cache. The ownership fix is still required because the restored files are created by the runner but Renovate reads them inside its container as user `12021`.
|
||||
|
||||
```yml
|
||||
name: Renovate
|
||||
on:
|
||||
# This lets you dispatch a renovate job with different cache options if you want to reset or disable the cache manually.
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
repoCache:
|
||||
description: 'Reset or disable the cache?'
|
||||
type: choice
|
||||
default: enabled
|
||||
options:
|
||||
- enabled
|
||||
- disabled
|
||||
- reset
|
||||
schedule:
|
||||
# Run every 30 minutes:
|
||||
- cron: '0,30 * * * *'
|
||||
|
||||
# Adding these as env variables makes it easy to re-use them in different steps and in bash.
|
||||
env:
|
||||
# This is the dir renovate provides -- if we set our own directory via cacheDir, we can run into permissions issues.
|
||||
# It is also possible to cache a higher level of the directory, but it has minimal benefit. While renovate execution
|
||||
# time gets faster, it also takes longer to upload the cache as it grows bigger.
|
||||
cache_dir: /tmp/renovate/cache/renovate/repository
|
||||
# This can be manually changed to bust the cache if necessary.
|
||||
cache_key: renovate-cache
|
||||
|
||||
jobs:
|
||||
renovate:
|
||||
name: Renovate
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v7.0.1
|
||||
|
||||
- name: Restore renovate cache
|
||||
id: cache-restore
|
||||
if: github.event.inputs.repoCache != 'disabled' && github.event.inputs.repoCache != 'reset'
|
||||
uses: actions/cache/restore@v6.1.0
|
||||
with:
|
||||
path: ${{ env.cache_dir }}
|
||||
key: ${{ env.cache_key }}-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
restore-keys: |
|
||||
${{ env.cache_key }}-
|
||||
|
||||
- name: Fix restored cache ownership
|
||||
if: steps.cache-restore.outputs.cache-matched-key != ''
|
||||
run: |
|
||||
sudo chown -R 12021:0 /tmp/renovate/
|
||||
ls -R $cache_dir
|
||||
|
||||
- uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
configurationFile: renovate.json5
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
renovate-version: 45.16.0
|
||||
env:
|
||||
# This enables the cache -- if this is set, it's not necessary to add it to renovate.json.
|
||||
RENOVATE_REPOSITORY_CACHE: ${{ github.event.inputs.repoCache || 'enabled' }}
|
||||
|
||||
- name: Save renovate cache
|
||||
if: github.event.inputs.repoCache != 'disabled' && steps.cache-restore.outputs.cache-hit != 'true'
|
||||
uses: actions/cache/save@v6.1.0
|
||||
with:
|
||||
path: ${{ env.cache_dir }}
|
||||
key: ${{ env.cache_key }}-${{ github.run_id }}-${{ github.run_attempt }}
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Debug logging
|
||||
|
||||
In case of issues, it's always a good idea to enable debug logging first.
|
||||
To enable debug logging, add the environment variable `LOG_LEVEL: 'debug'` to the action:
|
||||
|
||||
```yml
|
||||
- name: Self-hosted Renovate
|
||||
uses: renovatebot/github-action@v48.0.1
|
||||
with:
|
||||
configurationFile: example/renovate-config.js
|
||||
token: ${{ secrets.RENOVATE_TOKEN }}
|
||||
env:
|
||||
LOG_LEVEL: 'debug'
|
||||
```
|
||||
|
||||
### Special token requirements when using the `github-actions` manager
|
||||
|
||||
If you want to use the `github-actions` [manager](https://docs.renovatebot.com/modules/manager/github-actions/) in Renovate, ensure that the `token` you provide contains the `workflow` scope.
|
||||
Otherwise, GitHub does not allow Renovate to update workflow files and therefore it will be unable to create update PRs for affected packages (like `actions/checkout` or `renovatebot/github-action` itself).
|
||||
+6
-58
@@ -1,4 +1,4 @@
|
||||
name: 'Renovate Bot GitHub Action'
|
||||
name: 'Self-Hosted Renovate'
|
||||
description: 'GitHub Action to run self-hosted Renovate.'
|
||||
author: 'Jeroen de Bruijn'
|
||||
branding:
|
||||
@@ -6,66 +6,14 @@ branding:
|
||||
color: blue
|
||||
inputs:
|
||||
configurationFile:
|
||||
description: |
|
||||
Configuration file to configure Renovate. Either use this input or the
|
||||
'RENOVATE_CONFIG_FILE' environment variable.
|
||||
description: 'Configuration file to configure Renovate'
|
||||
required: false
|
||||
default: src/config.js
|
||||
token:
|
||||
description: |
|
||||
GitHub personal access token that Renovate should use. This should be
|
||||
configured using a Secret. Either use this input or the 'RENOVATE_TOKEN'
|
||||
environment variable.
|
||||
required: false
|
||||
env-regex:
|
||||
description: |
|
||||
Override the environment variables which will be passed into the renovate container.
|
||||
Defaults to `^(?:RENOVATE_\\w+|LOG_LEVEL|GITHUB_COM_TOKEN|NODE_OPTIONS|NO_COLOR|(?:HTTPS?|NO)_PROXY|(?:https?|no)_proxy)$`
|
||||
required: false
|
||||
additional-env-list:
|
||||
description: |
|
||||
A newline-separated list of environment variable names to pass through to the Renovate container, in addition to those already matched by env-regex.
|
||||
required: false
|
||||
renovate-version:
|
||||
description: |
|
||||
Renovate version to use.
|
||||
required: false
|
||||
default: '45' # renovate
|
||||
renovate-image:
|
||||
description: |
|
||||
Renovate docker image name.
|
||||
required: false
|
||||
default: ghcr.io/renovatebot/renovate
|
||||
mount-docker-socket:
|
||||
description: |
|
||||
Mount the Docker socket inside the renovate container so that the commands
|
||||
can use Docker. Also add the user inside the renovate container to the
|
||||
docker group for socket permissions.
|
||||
required: false
|
||||
docker-socket-host-path:
|
||||
description: |
|
||||
Allows the overriding of the host path for the Docker socket that is mounted into the container.
|
||||
Useful on systems where the host Docker socket is located somewhere other than '/var/run/docker.sock' (the default).
|
||||
Only applicable when 'mount-docker-socket' is true.
|
||||
required: false
|
||||
default: /var/run/docker.sock
|
||||
docker-cmd-file:
|
||||
description: |
|
||||
Override docker command. Default command is `renovate`
|
||||
required: false
|
||||
docker-network:
|
||||
description: |
|
||||
Docker network.
|
||||
required: false
|
||||
docker-user:
|
||||
description: |
|
||||
Docker user. Default to an unprivileged user
|
||||
required: false
|
||||
docker-volumes:
|
||||
description: |
|
||||
Docker volume mounts. Default to /tmp:/tmp
|
||||
default: /tmp:/tmp
|
||||
required: false
|
||||
|
||||
configured using a Secret.
|
||||
required: true
|
||||
runs:
|
||||
using: node24
|
||||
using: node12
|
||||
main: dist/index.js
|
||||
@@ -1,3 +1,3 @@
|
||||
export default {
|
||||
module.exports = {
|
||||
extends: ['@commitlint/config-conventional'],
|
||||
};
|
||||
Vendored
+1852
File diff suppressed because it is too large.
Load diff
@@ -1,7 +0,0 @@
|
||||
#!/bin/sh
|
||||
|
||||
set -e
|
||||
|
||||
install-apt sl
|
||||
|
||||
exec runuser -u ubuntu renovate
|
||||
@@ -1,3 +0,0 @@
|
||||
{
|
||||
"type": "commonjs"
|
||||
}
|
||||
@@ -1,18 +1,29 @@
|
||||
module.exports = {
|
||||
branchPrefix: 'test-renovate/',
|
||||
username: 'renovate-release',
|
||||
dryRun: true,
|
||||
gitAuthor: 'Renovate Bot <bot@renovateapp.com>',
|
||||
logLevel: 'debug',
|
||||
onboarding: false,
|
||||
platform: 'github',
|
||||
forkProcessing: 'enabled',
|
||||
dryRun: 'full',
|
||||
repositories: ['renovate-tests/cocoapods1', 'renovate-tests/gomod1'],
|
||||
includeForks: true,
|
||||
repositories: [
|
||||
'renovatebot/github-action',
|
||||
'renovate-tests/cocoapods1',
|
||||
'renovate-tests/gomod1',
|
||||
],
|
||||
packageRules: [
|
||||
{
|
||||
description: 'lockFileMaintenance',
|
||||
matchUpdateTypes: ['pin', 'digest', 'patch', 'minor', 'major', 'lockFileMaintenance'],
|
||||
dependencyDashboardApproval: false,
|
||||
minimumReleaseAge: null,
|
||||
updateTypes: [
|
||||
'pin',
|
||||
'digest',
|
||||
'patch',
|
||||
'minor',
|
||||
'major',
|
||||
'lockFileMaintenance',
|
||||
],
|
||||
masterIssueApproval: false,
|
||||
stabilityDays: 0,
|
||||
},
|
||||
],
|
||||
};
|
||||
@@ -1,11 +1,11 @@
|
||||
{
|
||||
"branchPrefix": "test-renovate/",
|
||||
"dryRun": "full",
|
||||
"username": "renovate-release",
|
||||
"dryRun": true,
|
||||
"gitAuthor": "Renovate Bot <bot@renovateapp.com>",
|
||||
"logLevel": "debug",
|
||||
"onboarding": false,
|
||||
"platform": "github",
|
||||
"forkProcessing": "enabled",
|
||||
"includeForks": true,
|
||||
"repositories": [
|
||||
"renovatebot/github-action",
|
||||
"renovate-tests/cocoapods1",
|
||||
@@ -14,9 +14,16 @@
|
||||
"packageRules": [
|
||||
{
|
||||
"description": "lockFileMaintenance",
|
||||
"matchUpdateTypes": ["pin", "digest", "patch", "minor", "major", "lockFileMaintenance"],
|
||||
"dependencyDashboardApproval": false,
|
||||
"minimumReleaseAge": "1 day"
|
||||
"updateTypes": [
|
||||
"pin",
|
||||
"digest",
|
||||
"patch",
|
||||
"minor",
|
||||
"major",
|
||||
"lockFileMaintenance"
|
||||
],
|
||||
"masterIssueApproval": false,
|
||||
"stabilityDays": 0
|
||||
}
|
||||
]
|
||||
}
|
||||
Generated
+5115
File diff suppressed because it is too large.
Load diff
+44
-51
@@ -1,64 +1,57 @@
|
||||
{
|
||||
"name": "github-action",
|
||||
"version": "0.0.0-PLACEHOLDER",
|
||||
"private": true,
|
||||
"version": "24.5.2",
|
||||
"description": "GitHub Action to run Renovate self-hosted.",
|
||||
"homepage": "https://github.com/renovatebot/github-action#readme",
|
||||
"bugs": {
|
||||
"url": "https://github.com/renovatebot/github-action/issues"
|
||||
"private": true,
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"format": "prettier --write \"**/*.{js,jsx,vue,ts,css,less,scss,html,htm,json,md,markdown,yml,yaml}\"",
|
||||
"format:file": "prettier --write",
|
||||
"lint": "concurrently npm:lint-es",
|
||||
"lint:fix": "concurrently npm:lint-es:fix",
|
||||
"lint-es": "eslint --ext .ts,.tsx,.js,.jsx,.json .",
|
||||
"lint-es:file": "eslint --ext .ts,.tsx,.js,.jsx,.json",
|
||||
"lint-es:fix": "eslint --ext .ts,.tsx,.js,.jsx,.json --fix .",
|
||||
"lint-es:file:fix": "eslint --ext .ts,.tsx,.js,.jsx,.json --fix",
|
||||
"release:version": "node_modules/.bin/ts-node src/get-version",
|
||||
"release:commit": "git add --force dist",
|
||||
"release:standard-version": "standard-version --release-as",
|
||||
"release": "run-s build release:commit \"release:standard-version -- {1}\" --",
|
||||
"build": "ncc build -o dist",
|
||||
"start": "run-s build && node dist"
|
||||
},
|
||||
"license": "GPL-3.0-or-later",
|
||||
"author": "Jeroen de Bruijn",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/renovatebot/github-action.git"
|
||||
},
|
||||
"type": "module",
|
||||
"main": "src/index.ts",
|
||||
"scripts": {
|
||||
"build": "run-s clean compile",
|
||||
"clean": "rimraf dist/",
|
||||
"compile": "node tools/compile.js",
|
||||
"lint": "run-s lint:*",
|
||||
"lint:oxlint": "oxlint",
|
||||
"lint:oxfmt": "oxfmt --check",
|
||||
"fix": "run-s fix:*",
|
||||
"fix:oxlint": "oxlint --fix",
|
||||
"fix:oxfmt": "oxfmt",
|
||||
"prepare": "husky",
|
||||
"release": "run-s clean build semantic-release",
|
||||
"semantic-release": "semantic-release",
|
||||
"start": "run-s build && node dist"
|
||||
"author": "Jeroen de Bruijn",
|
||||
"license": "GPL-3.0-or-later",
|
||||
"bugs": {
|
||||
"url": "https://github.com/renovatebot/github-action/issues"
|
||||
},
|
||||
"homepage": "https://github.com/renovatebot/github-action#readme",
|
||||
"dependencies": {
|
||||
"@actions/core": "3.0.1",
|
||||
"@actions/exec": "3.0.0"
|
||||
"@actions/core": "1.2.6",
|
||||
"@actions/exec": "1.0.4"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@commitlint/cli": "21.3.0",
|
||||
"@commitlint/config-conventional": "21.3.0",
|
||||
"@containerbase/oxlint-plugin": "1.1.0",
|
||||
"@semantic-release/git": "11.0.1",
|
||||
"@semantic-release/github": "12.0.11",
|
||||
"@semantic-release/npm": "13.2.0",
|
||||
"@tsconfig/node24": "24.0.6",
|
||||
"@tsconfig/strictest": "2.0.9",
|
||||
"@types/node": "24.19.4",
|
||||
"conventional-changelog-conventionalcommits": "9.3.1",
|
||||
"esbuild": "0.28.2",
|
||||
"husky": "9.1.7",
|
||||
"lint-staged": "17.6.3",
|
||||
"npm-run-all2": "9.1.0",
|
||||
"oxfmt": "0.80.0",
|
||||
"oxlint": "1.95.0",
|
||||
"oxlint-tsgolint": "7.0.2009",
|
||||
"rimraf": "6.1.4",
|
||||
"semantic-release": "25.0.9",
|
||||
"typescript": "5.9.3"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=24.11.0",
|
||||
"pnpm": "^10.0.0"
|
||||
},
|
||||
"packageManager": "pnpm@10.34.9"
|
||||
"@commitlint/cli": "11.0.0",
|
||||
"@commitlint/config-conventional": "11.0.0",
|
||||
"@types/node": "13.13.34",
|
||||
"@typescript-eslint/eslint-plugin": "4.6.0",
|
||||
"@typescript-eslint/parser": "4.6.0",
|
||||
"@zeit/ncc": "0.22.3",
|
||||
"concurrently": "5.3.0",
|
||||
"eslint": "7.12.1",
|
||||
"eslint-config-prettier": "6.15.0",
|
||||
"eslint-plugin-json": "2.1.2",
|
||||
"eslint-plugin-prettier": "3.1.4",
|
||||
"husky": "4.3.0",
|
||||
"lint-staged": "10.5.3",
|
||||
"npm-run-all": "4.1.5",
|
||||
"prettier": "2.2.1",
|
||||
"standard-version": "9.0.0",
|
||||
"ts-node": "9.1.1",
|
||||
"typescript": "4.1.2"
|
||||
}
|
||||
}
|
||||
Generated
-3747
File diff suppressed because it is too large.
Load diff
@@ -1,18 +0,0 @@
|
||||
strictPeerDependencies: true
|
||||
saveExact: true
|
||||
dedupePeers: true
|
||||
# updates are handled by Renovate itself
|
||||
updateNotifier: false
|
||||
|
||||
allowBuilds:
|
||||
esbuild: false
|
||||
|
||||
# in line with https://github.com/renovatebot/.github/blob/main/default.json,
|
||||
# all non-Renovate or non-Containerbase packages should only be installed after
|
||||
# 7 days
|
||||
minimumReleaseAge: 10080
|
||||
minimumReleaseAgeExclude:
|
||||
- '@renovatebot/*'
|
||||
- '@containerbase/*'
|
||||
# Renovate security update: esbuild@0.28.1
|
||||
- esbuild@0.28.1
|
||||
+12
-31
@@ -1,35 +1,16 @@
|
||||
import { info, warning } from '@actions/core';
|
||||
import type { Input } from './input';
|
||||
|
||||
export class Docker {
|
||||
private static readonly image = 'ghcr.io/renovatebot/renovate';
|
||||
private static readonly version = '45'; // renovate
|
||||
|
||||
private readonly fullImageReference: string;
|
||||
|
||||
constructor(input: Input) {
|
||||
let image = input.getDockerImage();
|
||||
let version = input.getVersion();
|
||||
|
||||
if (image?.includes(':')) {
|
||||
info(`Docker image looks like it contains a version, using that as the image itself`);
|
||||
this.fullImageReference = image;
|
||||
return;
|
||||
}
|
||||
|
||||
if (!image) {
|
||||
warning(`No Docker image specified, using ${Docker.image}`);
|
||||
image = Docker.image;
|
||||
}
|
||||
if (!version) {
|
||||
warning(`No Docker version specified, using ${Docker.version}`);
|
||||
version = Docker.version;
|
||||
}
|
||||
|
||||
this.fullImageReference = `${image}:${version}`;
|
||||
}
|
||||
class Docker {
|
||||
readonly repository = 'renovate/renovate';
|
||||
// renovate: datasource=docker depName=renovate/renovate versioning=docker
|
||||
readonly tag = '24.5.2-slim';
|
||||
readonly tagSuffix = '-slim';
|
||||
|
||||
image(): string {
|
||||
return this.fullImageReference;
|
||||
return `${this.repository}:${this.tag}`;
|
||||
}
|
||||
|
||||
version(): string {
|
||||
return this.tag.replace(this.tagSuffix, '');
|
||||
}
|
||||
}
|
||||
|
||||
export default Docker;
|
||||
@@ -0,0 +1,5 @@
|
||||
import * as core from '@actions/core';
|
||||
import Docker from './docker';
|
||||
|
||||
const docker = new Docker();
|
||||
core.setOutput('version', docker.version());
|
||||
+6
-11
@@ -1,22 +1,17 @@
|
||||
import { group, notice, setFailed } from '@actions/core';
|
||||
import { Input } from './input';
|
||||
import { Renovate } from './renovate';
|
||||
import * as core from '@actions/core';
|
||||
import Input from './input';
|
||||
import Renovate from './renovate';
|
||||
|
||||
async function run(): Promise<void> {
|
||||
try {
|
||||
const input = new Input();
|
||||
const renovate = new Renovate(input);
|
||||
|
||||
await group('Check Renovate version', async () => {
|
||||
const version = await renovate.runDockerContainerForVersion();
|
||||
notice(version, { title: 'Renovate CLI version' });
|
||||
});
|
||||
const renovate = new Renovate(input.configurationFile, input.token);
|
||||
|
||||
await renovate.runDockerContainer();
|
||||
} catch (error) {
|
||||
console.error(error);
|
||||
setFailed(error as Error);
|
||||
core.setFailed(error.message);
|
||||
}
|
||||
}
|
||||
|
||||
void run();
|
||||
run();
|
||||
+14
-131
@@ -1,137 +1,20 @@
|
||||
import path from 'node:path';
|
||||
import { getInput, getMultilineInput, warning } from '@actions/core';
|
||||
import * as core from '@actions/core';
|
||||
|
||||
export interface EnvironmentVariable {
|
||||
key: string;
|
||||
value: string;
|
||||
}
|
||||
|
||||
export class Input {
|
||||
readonly options = {
|
||||
envRegex:
|
||||
/^(?:RENOVATE_\w+|LOG_LEVEL|GITHUB_COM_TOKEN|NODE_OPTIONS|NO_COLOR|(?:HTTPS?|NO)_PROXY|(?:https?|no)_proxy)$/,
|
||||
configurationFile: {
|
||||
input: 'configurationFile',
|
||||
env: 'RENOVATE_CONFIG_FILE',
|
||||
optional: true,
|
||||
},
|
||||
token: {
|
||||
input: 'token',
|
||||
env: 'RENOVATE_TOKEN',
|
||||
optional: false,
|
||||
},
|
||||
} as const;
|
||||
readonly token: Readonly<EnvironmentVariable>;
|
||||
|
||||
private readonly _environmentVariables: Map<string, string>;
|
||||
private readonly _configurationFile: Readonly<EnvironmentVariable>;
|
||||
class Input {
|
||||
readonly configurationFile = core.getInput('configurationFile', {
|
||||
required: true,
|
||||
});
|
||||
readonly token = core.getInput('token', { required: true });
|
||||
|
||||
constructor() {
|
||||
const envRegexInput = getInput('env-regex');
|
||||
const envRegex = envRegexInput ? new RegExp(envRegexInput) : this.options.envRegex;
|
||||
const additionalEnvVarNames = getMultilineInput('additional-env-list');
|
||||
this._environmentVariables = new Map(
|
||||
Object.entries(process.env)
|
||||
.filter(([key]) => envRegex.test(key) || additionalEnvVarNames.includes(key))
|
||||
.filter((pair): pair is [string, string] => pair[1] !== undefined),
|
||||
);
|
||||
for (const name of additionalEnvVarNames) {
|
||||
if (!this._environmentVariables.has(name)) {
|
||||
warning(
|
||||
`Environment variable '${name}' listed in 'additional-env-list' was not found in the parent process environment; it will not be passed to the renovate container.`,
|
||||
);
|
||||
}
|
||||
this.validate();
|
||||
}
|
||||
|
||||
validate(): void {
|
||||
if (this.token === '') {
|
||||
throw new Error('input.token MUST NOT be empty');
|
||||
}
|
||||
|
||||
this.token = this.get(
|
||||
this.options.token.input,
|
||||
this.options.token.env,
|
||||
this.options.token.optional,
|
||||
);
|
||||
this._configurationFile = this.get(
|
||||
this.options.configurationFile.input,
|
||||
this.options.configurationFile.env,
|
||||
this.options.configurationFile.optional,
|
||||
);
|
||||
}
|
||||
|
||||
configurationFile(): EnvironmentVariable | null {
|
||||
if (this._configurationFile.value !== '') {
|
||||
return {
|
||||
key: this._configurationFile.key,
|
||||
value: path.resolve(this._configurationFile.value),
|
||||
};
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
getDockerImage(): string | null {
|
||||
return getInput('renovate-image') || null;
|
||||
}
|
||||
|
||||
getVersion(): string | null {
|
||||
return getInput('renovate-version') || null;
|
||||
}
|
||||
|
||||
mountDockerSocket(): boolean {
|
||||
return getInput('mount-docker-socket') === 'true';
|
||||
}
|
||||
|
||||
dockerSocketHostPath(): string {
|
||||
return getInput('docker-socket-host-path') || '/var/run/docker.sock';
|
||||
}
|
||||
|
||||
getDockerCmdFile(): string | null {
|
||||
const cmdFile = getInput('docker-cmd-file');
|
||||
return !!cmdFile && cmdFile !== '' ? path.resolve(cmdFile) : null;
|
||||
}
|
||||
|
||||
getDockerUser(): string | null {
|
||||
return getInput('docker-user') || null;
|
||||
}
|
||||
|
||||
getDockerVolumeMounts(): string[] {
|
||||
return getInput('docker-volumes')
|
||||
.split(';')
|
||||
.map((v) => v.trim())
|
||||
.filter((v) => !!v);
|
||||
}
|
||||
|
||||
getDockerNetwork(): string {
|
||||
return getInput('docker-network');
|
||||
}
|
||||
|
||||
/**
|
||||
* Convert to environment variables.
|
||||
*
|
||||
* @note The environment variables listed below are filtered out.
|
||||
* - Token, available with the `token` property.
|
||||
* - Configuration file, available with the `configurationFile()` method.
|
||||
*/
|
||||
toEnvironmentVariables(): EnvironmentVariable[] {
|
||||
return [...this._environmentVariables].map(([key, value]) => ({
|
||||
key,
|
||||
value,
|
||||
}));
|
||||
}
|
||||
|
||||
private get(input: string, env: string, optional: boolean): EnvironmentVariable {
|
||||
const fromInput = getInput(input);
|
||||
const fromEnv = this._environmentVariables.get(env);
|
||||
|
||||
if (fromInput === '' && fromEnv === undefined && !optional) {
|
||||
throw new Error(
|
||||
[`'${input}' MUST be passed using its input or the '${env}'`, 'environment variable'].join(
|
||||
' ',
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
this._environmentVariables.delete(env);
|
||||
if (fromInput !== '') {
|
||||
return { key: env, value: fromInput };
|
||||
}
|
||||
return { key: env, value: fromEnv ?? '' };
|
||||
}
|
||||
}
|
||||
|
||||
export default Input;
|
||||
+50
-99
@@ -1,102 +1,43 @@
|
||||
import fs from 'node:fs/promises';
|
||||
import path from 'node:path';
|
||||
import { exec, getExecOutput } from '@actions/exec';
|
||||
import { Docker } from './docker';
|
||||
import { Input } from './input';
|
||||
import Docker from './docker';
|
||||
import { exec } from '@actions/exec';
|
||||
import fs from 'fs';
|
||||
import path from 'path';
|
||||
|
||||
export class Renovate {
|
||||
static dockerGroupRegex = /^docker:x:(?<groupId>[1-9][0-9]*):/m;
|
||||
private static readonly userAgentKey = 'RENOVATE_USER_AGENT';
|
||||
private static readonly defaultUserAgent =
|
||||
'Renovate/{{renovateVersion}} (https://github.com/renovatebot/github-action)';
|
||||
class Renovate {
|
||||
private configFileEnv = 'RENOVATE_CONFIG_FILE';
|
||||
private tokenEnv = 'RENOVATE_TOKEN';
|
||||
private dockerGroupName = 'docker';
|
||||
private configFileMountDir = '/github-action';
|
||||
|
||||
private configFile: string;
|
||||
private docker: Docker;
|
||||
|
||||
constructor(private input: Input) {
|
||||
this.docker = new Docker(input);
|
||||
}
|
||||
constructor(configFile: string, private token: string) {
|
||||
this.configFile = path.resolve(configFile);
|
||||
|
||||
async runDockerContainerForVersion(): Promise<string> {
|
||||
const command = `docker run --env FORCE_COLOR=3 --rm ${this.docker.image()} --version`;
|
||||
this.validateArguments();
|
||||
|
||||
const { exitCode, stdout } = await getExecOutput(command);
|
||||
if (exitCode !== 0) {
|
||||
throw new Error(`'docker run' failed with exit code ${exitCode}.`);
|
||||
}
|
||||
|
||||
return stdout.trim();
|
||||
this.docker = new Docker();
|
||||
}
|
||||
|
||||
async runDockerContainer(): Promise<void> {
|
||||
await this.validateArguments();
|
||||
|
||||
const dockerArguments = this.input
|
||||
.toEnvironmentVariables()
|
||||
.map((e) => `--env ${e.key}`)
|
||||
.concat([`--env ${this.input.token.key}=${this.input.token.value} --env FORCE_COLOR=3`]);
|
||||
|
||||
if (!this.input.toEnvironmentVariables().some((e) => e.key === Renovate.userAgentKey)) {
|
||||
dockerArguments.push(`--env "${Renovate.userAgentKey}=${Renovate.defaultUserAgent}"`);
|
||||
}
|
||||
|
||||
const configurationFile = this.input.configurationFile();
|
||||
if (configurationFile !== null) {
|
||||
const baseName = path.basename(configurationFile.value);
|
||||
const mountPath = path.join(this.configFileMountDir, baseName);
|
||||
dockerArguments.push(
|
||||
`--env ${configurationFile.key}=${mountPath}`,
|
||||
`--volume ${configurationFile.value}:${mountPath}`,
|
||||
);
|
||||
}
|
||||
|
||||
if (this.input.mountDockerSocket()) {
|
||||
const sockPath = this.input.dockerSocketHostPath();
|
||||
const stat = await fs.stat(sockPath);
|
||||
if (!stat.isSocket()) {
|
||||
throw new Error(`docker socket host path '${sockPath}' MUST exist and be a socket`);
|
||||
}
|
||||
|
||||
dockerArguments.push(
|
||||
`--volume ${sockPath}:/var/run/docker.sock`,
|
||||
`--group-add ${await this.getDockerGroupId()}`,
|
||||
);
|
||||
}
|
||||
|
||||
const dockerCmdFile = this.input.getDockerCmdFile();
|
||||
let dockerCmd: string | null = null;
|
||||
if (dockerCmdFile !== null) {
|
||||
const baseName = path.basename(dockerCmdFile);
|
||||
const mountPath = `/${baseName}`;
|
||||
dockerArguments.push(`--volume ${dockerCmdFile}:${mountPath}`);
|
||||
dockerCmd = mountPath;
|
||||
}
|
||||
|
||||
const dockerUser = this.input.getDockerUser();
|
||||
if (dockerUser !== null) {
|
||||
dockerArguments.push(`--user ${dockerUser}`);
|
||||
}
|
||||
|
||||
for (const volumeMount of this.input.getDockerVolumeMounts()) {
|
||||
dockerArguments.push(`--volume ${volumeMount}`);
|
||||
}
|
||||
|
||||
const dockerNetwork = this.input.getDockerNetwork();
|
||||
if (dockerNetwork) {
|
||||
dockerArguments.push(`--network ${dockerNetwork}`);
|
||||
}
|
||||
|
||||
dockerArguments.push('--rm', this.docker.image());
|
||||
|
||||
if (dockerCmd !== null) {
|
||||
dockerArguments.push(dockerCmd);
|
||||
}
|
||||
|
||||
const command = `docker run ${dockerArguments.join(' ')}`;
|
||||
const renovateDockerUser = 'ubuntu';
|
||||
const githubActionsDockerGroupId = this.getDockerGroupId();
|
||||
const commandArguments = [
|
||||
'--rm',
|
||||
`--env ${this.configFileEnv}=${this.configFileMountPath()}`,
|
||||
`--env ${this.tokenEnv}=${this.token}`,
|
||||
`--volume ${this.configFile}:${this.configFileMountPath()}`,
|
||||
`--volume /var/run/docker.sock:/var/run/docker.sock`,
|
||||
`--volume /tmp:/tmp`,
|
||||
`--user ${renovateDockerUser}:${githubActionsDockerGroupId}`,
|
||||
this.docker.image(),
|
||||
];
|
||||
const command = `docker run ${commandArguments.join(' ')}`;
|
||||
|
||||
const code = await exec(command);
|
||||
if (code !== 0) {
|
||||
throw new Error(`'docker run' failed with exit code ${code}.`);
|
||||
new Error(`'docker run' failed with exit code ${code}.`);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -106,9 +47,9 @@ export class Renovate {
|
||||
* The Renovate container needs access to this group in order to have the
|
||||
* required permissions on the Docker socket.
|
||||
*/
|
||||
private async getDockerGroupId(): Promise<string> {
|
||||
private getDockerGroupId(): string {
|
||||
const groupFile = '/etc/group';
|
||||
const groups = await fs.readFile(groupFile, {
|
||||
const groups = fs.readFileSync(groupFile, {
|
||||
encoding: 'utf-8',
|
||||
});
|
||||
|
||||
@@ -118,22 +59,32 @@ export class Renovate {
|
||||
*
|
||||
* Source: https://www.thegeekdiary.com/etcgroup-file-explained/
|
||||
*/
|
||||
const match = Renovate.dockerGroupRegex.exec(groups);
|
||||
if (match?.groups?.groupId === undefined) {
|
||||
throw new Error(`Could not find group docker in ${groupFile}`);
|
||||
const re = new RegExp(`^${this.dockerGroupName}:x:([1-9][0-9]*):`, 'm');
|
||||
const match = re.exec(groups);
|
||||
if (!match || match.length < 2) {
|
||||
throw new Error(
|
||||
`Could not find group '${this.dockerGroupName}' in ${groupFile}`
|
||||
);
|
||||
}
|
||||
|
||||
return match.groups.groupId;
|
||||
return match[1];
|
||||
}
|
||||
|
||||
private async validateArguments(): Promise<void> {
|
||||
if (/\s/.test(this.input.token.value)) {
|
||||
throw new Error('Token MUST NOT contain whitespace');
|
||||
private validateArguments(): void {
|
||||
if (!fs.existsSync(this.configFile)) {
|
||||
throw new Error(
|
||||
`Could not locate configuration file '${this.configFile}'.`
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
const configurationFile = this.input.configurationFile();
|
||||
if (configurationFile !== null && !(await fs.stat(configurationFile.value)).isFile()) {
|
||||
throw new Error(`configuration file '${configurationFile.value}' MUST be an existing file`);
|
||||
}
|
||||
private configFileName(): string {
|
||||
return path.basename(this.configFile);
|
||||
}
|
||||
|
||||
private configFileMountPath(): string {
|
||||
return path.join(this.configFileMountDir, this.configFileName());
|
||||
}
|
||||
}
|
||||
|
||||
export default Renovate;
|
||||
@@ -0,0 +1,10 @@
|
||||
{
|
||||
"extends": "../tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"sourceMap": false,
|
||||
"declaration": false,
|
||||
"rootDir": ".",
|
||||
"outDir": "dist",
|
||||
"types": ["node"]
|
||||
}
|
||||
}
|
||||
@@ -1,8 +0,0 @@
|
||||
// https://github.com/evanw/esbuild/issues/1921#issuecomment-1898197331
|
||||
import { createRequire } from 'node:module';
|
||||
import path from 'node:path';
|
||||
import url from 'node:url';
|
||||
|
||||
globalThis.require = createRequire(import.meta.url);
|
||||
globalThis.__filename = url.fileURLToPath(import.meta.url);
|
||||
globalThis.__dirname = path.dirname(__filename);
|
||||
@@ -1,15 +0,0 @@
|
||||
import { env } from 'node:process';
|
||||
import { build } from 'esbuild';
|
||||
|
||||
await build({
|
||||
entryPoints: ['./src/index.ts'],
|
||||
bundle: true,
|
||||
platform: 'node',
|
||||
target: 'node24',
|
||||
minify: !!env.CI,
|
||||
tsconfig: 'tsconfig.dist.json',
|
||||
sourcemap: true,
|
||||
format: 'esm',
|
||||
outdir: './dist/',
|
||||
inject: ['tools/cjs-shim.ts'], // https://github.com/evanw/esbuild/issues/1921#issuecomment-1898197331
|
||||
});
|
||||
@@ -1,8 +0,0 @@
|
||||
{
|
||||
"extends": ["@tsconfig/strictest/tsconfig.json", "@tsconfig/node24/tsconfig.json"],
|
||||
"compilerOptions": {
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"esModuleInterop": true,
|
||||
"noEmit": true
|
||||
}
|
||||
}
|
||||
@@ -1,7 +0,0 @@
|
||||
{
|
||||
"extends": "./tsconfig.json",
|
||||
"compilerOptions": {
|
||||
"types": ["node"]
|
||||
},
|
||||
"files": ["./src/index.ts"]
|
||||
}
|
||||
+8
-8
@@ -1,13 +1,13 @@
|
||||
{
|
||||
"extends": ["@tsconfig/strictest/tsconfig.json", "@tsconfig/node24/tsconfig.json"],
|
||||
"compilerOptions": {
|
||||
"allowJs": true,
|
||||
"target": "es2020",
|
||||
"module": "commonjs",
|
||||
"moduleResolution": "node",
|
||||
"resolveJsonModule": true,
|
||||
"esModuleInterop": true,
|
||||
"allowSyntheticDefaultImports": true,
|
||||
"outDir": "dist",
|
||||
"module": "ESNext",
|
||||
"moduleResolution": "Bundler",
|
||||
"noImplicitAny": false,
|
||||
"noPropertyAccessFromIndexSignature": false /* makes code more complex */
|
||||
"outDir": "dist"
|
||||
},
|
||||
"exclude": ["node_modules/", "**/__mocks__/*", "dist/", "coverage/", "html/"]
|
||||
"include": ["src/**/*.ts", "bin/**/*.ts"],
|
||||
"exclude": ["node_modules", "**/*.test.ts"]
|
||||
}
|
||||
Reference in new issue
Block a user