|
| 1 | +name: Run build for renovate PRs |
| 2 | + |
| 3 | +on: |
| 4 | + pull_request: |
| 5 | + types: [opened, synchronize] |
| 6 | + |
| 7 | +permissions: |
| 8 | + contents: read |
| 9 | + |
| 10 | +defaults: |
| 11 | + run: |
| 12 | + shell: bash |
| 13 | + |
| 14 | +concurrency: |
| 15 | + group: ${{ github.ref_name }}-renovate |
| 16 | + cancel-in-progress: true |
| 17 | + |
| 18 | +jobs: |
| 19 | + check: |
| 20 | + name: Check for changes |
| 21 | + runs-on: ubuntu-24.04 |
| 22 | + outputs: |
| 23 | + generate: ${{ steps.filter.outputs.generate }} |
| 24 | + permissions: |
| 25 | + pull-requests: read |
| 26 | + if: ${{ github.actor == 'renovate[bot]' }} |
| 27 | + steps: |
| 28 | + - name: Checkout repository |
| 29 | + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 |
| 30 | + |
| 31 | + - name: Check for changes |
| 32 | + uses: dorny/paths-filter@de90cc6fb38fc0963ad72b210f1f284cd68cea36 # v3.0.2 |
| 33 | + id: filter |
| 34 | + with: |
| 35 | + filters: | |
| 36 | + generate: |
| 37 | + - go.mod |
| 38 | + - go.sum |
| 39 | + - Makefile |
| 40 | + build: |
| 41 | + name: Build for renovate PRs |
| 42 | + runs-on: ubuntu-24.04 |
| 43 | + needs: check |
| 44 | + permissions: |
| 45 | + contents: write |
| 46 | + if: ${{ needs.check.outputs.generate == 'true' }} |
| 47 | + steps: |
| 48 | + - name: Checkout repository |
| 49 | + uses: actions/checkout@d632683dd7b4114ad314bca15554477dd762a938 # v4.2.0 |
| 50 | + with: |
| 51 | + ref: ${{ github.head_ref }} |
| 52 | + token: ${{ secrets.NGINX_PAT }} |
| 53 | + |
| 54 | + - name: Setup Golang Environment |
| 55 | + uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2 |
| 56 | + with: |
| 57 | + go-version: stable |
| 58 | + cache-dependency-path: | |
| 59 | + go.sum |
| 60 | + .github/.cache/buster-for-generate |
| 61 | +
|
| 62 | + # go mod tidy can be removed once https://github.com/renovatebot/renovate/issues/12999 is implemented |
| 63 | + - name: Update files for renovate |
| 64 | + run: | |
| 65 | + make generate-all |
| 66 | + cd tests && go mod tidy && go mod verify |
| 67 | +
|
| 68 | + - name: Commit changes |
| 69 | + id: commit |
| 70 | + uses: stefanzweifel/git-auto-commit-action@8621497c8c39c72f3e2a999a26b4ca1b5058a842 # v5.0.1 |
| 71 | + with: |
| 72 | + commit_message: "Update files for renovate" |
| 73 | + commit_user_name: "renovate[bot]" |
| 74 | + commit_user_email: "<29139614+renovate[bot]@users.noreply.github.com>" |
| 75 | + commit_author: "renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>" |
0 commit comments