diff --git a/.github/workflows/validate-renovate.yml b/.github/workflows/validate-renovate.yml index d58f7fd7..ca548b48 100644 --- a/.github/workflows/validate-renovate.yml +++ b/.github/workflows/validate-renovate.yml @@ -10,23 +10,51 @@ permissions: contents: read pull-requests: write +env: + # renovate: npm:renovate + RENOVATE_VERSION: '37.401.1' + jobs: lint: name: run renovate-config-validator runs-on: ubuntu-24.04 steps: - uses: actions/checkout@v4 - - name: run lint and report + - name: pull npx cache + id: pull-path + uses: actions/cache@v4 + with: + path: .github/workflows/cache/renovate-npx-path-${{ env.RENOVATE_VERSION }} + key: renovate-npx-path-${{ env.RENOVATE_VERSION }}-${{ env.CACHE_VERSION }} env: URL: ${{ github.event.pull_request.html_url }} GH_TOKEN: ${{ github.token }} - # renovate: npm:renovate - RENOVATE_VERSION: '37.401.1' + - name: output + id: extract-path + run: | + echo "LOCATION=$(cat ".github/workflows/cache/renovate-npx-path-${{ env.RENOVATE_VERSION }}")" >> "$GITHUB_OUTPUT" + - name: pull npx cache (phase 2) + if: ${{ steps.pull-path.outputs.cache-hit }} + id: pull-actual + uses: actions/cache@v4 + with: + path: '${{ steps.extract-path.outputs.LOCATION }}' + key: renovate-npx-${{ env.RENOVATE_VERSION }}-${{ env.CACHE_VERSION }} + - name: install if necessary + if: '${{ ! (steps.pull-path.outputs.cache-hit && steps.pull-actual.outputs.cache-hit ) }}' run: | + echo 'missed cache, installing' # pinned on exact version package="renovate@=$RENOVATE_VERSION" echo "npx: $(npx --version)" echo "installing: $package..." + npx --yes --package "$package" -- which renovate-config-validator + - name: run lint and collect + env: + URL: ${{ github.event.pull_request.html_url }} + GH_TOKEN: ${{ github.token }} + run: | + package="renovate@=$RENOVATE_VERSION" export H="$(mktemp)" se="$(mktemp)" echo '{' >> "$H" @@ -52,7 +80,6 @@ jobs: if [ "$(stat -c %s "$H")" -le 4 ]; then echo 'Migration is unnecessary, exiting (early)' exit 0 - exit 0 fi echo "---" @@ -118,7 +145,9 @@ jobs: echo '--- [DEBUG] REPORTER ---' cat "$COMMENT_BUFFER" echo '------------------------' - + echo "path=$COMMENT_BUFFER" >>"$GITHUB_OUTPUT" + - name: report and fail + run: | gh pr comment -F "$COMMENT_BUFFER" "${URL}" - + exit 1 diff --git a/renovate.json b/renovate.json index 4a3a771a..8d002448 100644 --- a/renovate.json +++ b/renovate.json @@ -33,3 +33,4 @@ } ] } +