Skip to content

Commit 487974b

Browse files
ci: add dependabot validation
1 parent 1a07431 commit 487974b

4 files changed

Lines changed: 61 additions & 2 deletions

File tree

.github/workflows/__renovate-config-validator.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,15 @@ jobs:
3434
# shellcheck disable=SC2086 # do not quote to keep this as a single line
3535
echo found=${files} >> "${GITHUB_OUTPUT}"
3636
37+
- name: Setup Node
38+
if: steps.find-files.outputs.found != ''
39+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
40+
with:
41+
node-version: latest
42+
3743
- name: Install npm dependencies
3844
if: steps.find-files.outputs.found != ''
39-
run: npm install --ignore-scripts --global renovate
45+
run: npm install --ignore-scripts
4046

4147
- name: renovate config validator
4248
if: steps.find-files.outputs.found != ''
@@ -47,7 +53,7 @@ jobs:
4753
4854
for FILE in ${{ steps.find-files.outputs.found }}; do
4955
file_status=0
50-
renovate-config-validator --strict ${FILE} || file_status=$?
56+
npm run validate-renovate -- ${FILE} || file_status=$?
5157
5258
# set github step summary
5359
if [ $file_status -ne 0 ]; then
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
# This workflow is centrally managed in https://github.com/<organization>/.github/
3+
# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in
4+
# the above-mentioned repo.
5+
6+
# Validate Dependabot config files.
7+
8+
name: validate dependabot config
9+
permissions: {}
10+
11+
on:
12+
pull_request:
13+
14+
concurrency:
15+
group: "${{ github.workflow }}-${{ github.ref }}"
16+
cancel-in-progress: true
17+
18+
jobs:
19+
validate-dependabot:
20+
permissions:
21+
contents: read
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
26+
27+
- name: Setup Node
28+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
29+
with:
30+
node-version: latest
31+
32+
- name: Install dependencies
33+
run: npm install --ignore-scripts
34+
35+
- name: Validate dependabot config
36+
run: npm run validate-dependabot

.gitignore

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -158,3 +158,7 @@ cython_debug/
158158
# and can be added to the global gitignore or merged into this file. For a more nuclear
159159
# option (not recommended) you can uncomment the following to ignore the entire idea folder.
160160
.idea/
161+
162+
# Node
163+
node_modules/
164+
package-lock.json

package.json

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
{
2+
"name": "lizardbyte-github",
3+
"version": "0.0.0",
4+
"description": "LizardByte .github repository",
5+
"scripts": {
6+
"validate-dependabot": "validate-dependabot-yaml",
7+
"validate-renovate": "renovate-config-validator --strict"
8+
},
9+
"devDependencies": {
10+
"@bugron/validate-dependabot-yaml": "0.3.3",
11+
"renovate": "43.96.0"
12+
}
13+
}

0 commit comments

Comments
 (0)