|
| 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.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 | +
|
| 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@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5.0.0 |
| 50 | + with: |
| 51 | + ref: ${{ github.head_ref }} |
| 52 | + |
| 53 | + - name: Configure GOPROXY |
| 54 | + id: goproxy |
| 55 | + run: | |
| 56 | + GOPROXY_VALUE=https://proxy.golang.org,direct |
| 57 | + if [ "${{ github.ref_name }}" = "${{ github.event.repository.default_branch }}" ] || [[ "${{ github.ref_name }}" =~ "release-" ]]; then |
| 58 | + GOPROXY_VALUE=${{ secrets.ARTIFACTORY_DEV_ENDPOINT }} |
| 59 | + fi |
| 60 | + echo "GOPROXY=${GOPROXY_VALUE}" >> $GITHUB_ENV |
| 61 | +
|
| 62 | + - name: Setup Golang Environment |
| 63 | + uses: actions/setup-go@44694675825211faa026b3c33043df3e48a5fa00 # v6.0.0 |
| 64 | + with: |
| 65 | + go-version-file: go.mod |
| 66 | + |
| 67 | + # go mod tidy can be removed once https://github.com/renovatebot/renovate/issues/12999 is implemented |
| 68 | + - name: Update files for renovate |
| 69 | + run: | |
| 70 | + make update-crds |
| 71 | + make update-codegen |
| 72 | +
|
| 73 | + - name: Commit changes |
| 74 | + id: commit |
| 75 | + uses: stefanzweifel/git-auto-commit-action@778341af668090896ca464160c2def5d1d1a3eb0 # v6.0.1 |
| 76 | + with: |
| 77 | + commit_message: "Update files for renovate" |
| 78 | + commit_author: "renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>" |
0 commit comments