diff --git a/.github/workflows/__validate-dependabot-config.yml b/.github/workflows/__validate-dependabot-config.yml new file mode 100644 index 00000000..b33b3eca --- /dev/null +++ b/.github/workflows/__validate-dependabot-config.yml @@ -0,0 +1,36 @@ +--- +# This workflow is centrally managed in https://github.com//.github/ +# Don't make changes to this file in this repo as they will be overwritten with changes made to the same file in +# the above-mentioned repo. + +# Validate Dependabot config files. + +name: validate dependabot config +permissions: {} + +on: + pull_request: + +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: true + +jobs: + validate-dependabot: + permissions: + contents: read + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + + - name: Setup Node + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + with: + node-version: latest + + - name: Install dependencies + run: npm install --ignore-scripts + + - name: Validate dependabot config + run: npm run validate-dependabot diff --git a/.github/workflows/__renovate-config-validator.yml b/.github/workflows/__validate-renovate-config.yml similarity index 81% rename from .github/workflows/__renovate-config-validator.yml rename to .github/workflows/__validate-renovate-config.yml index 91a021c5..8b65d3c0 100644 --- a/.github/workflows/__renovate-config-validator.yml +++ b/.github/workflows/__validate-renovate-config.yml @@ -5,7 +5,7 @@ # Validate Renovate config files. -name: renovate config validator +name: validate renovate config permissions: {} on: @@ -16,7 +16,7 @@ concurrency: cancel-in-progress: true jobs: - renovate-config-validator: + validate-renovate: permissions: contents: read runs-on: ubuntu-latest @@ -34,9 +34,15 @@ jobs: # shellcheck disable=SC2086 # do not quote to keep this as a single line echo found=${files} >> "${GITHUB_OUTPUT}" + - name: Setup Node + if: steps.find-files.outputs.found != '' + uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0 + with: + node-version: latest + - name: Install npm dependencies if: steps.find-files.outputs.found != '' - run: npm install --ignore-scripts --global renovate + run: npm install --ignore-scripts - name: renovate config validator if: steps.find-files.outputs.found != '' @@ -47,7 +53,7 @@ jobs: for FILE in ${{ steps.find-files.outputs.found }}; do file_status=0 - renovate-config-validator --strict ${FILE} || file_status=$? + npm run validate-renovate -- ${FILE} || file_status=$? # set github step summary if [ $file_status -ne 0 ]; then diff --git a/.gitignore b/.gitignore index 2dc53ca3..318a0c3b 100644 --- a/.gitignore +++ b/.gitignore @@ -158,3 +158,7 @@ cython_debug/ # and can be added to the global gitignore or merged into this file. For a more nuclear # option (not recommended) you can uncomment the following to ignore the entire idea folder. .idea/ + +# Node +node_modules/ +package-lock.json diff --git a/package.json b/package.json new file mode 100644 index 00000000..64cf121d --- /dev/null +++ b/package.json @@ -0,0 +1,13 @@ +{ + "name": "lizardbyte-github", + "version": "0.0.0", + "description": "LizardByte .github repository", + "scripts": { + "validate-dependabot": "validate-dependabot-yaml", + "validate-renovate": "renovate-config-validator --strict" + }, + "devDependencies": { + "@bugron/validate-dependabot-yaml": "0.3.3", + "renovate": "43.96.0" + } +}