| 1 |
name: "Project: Tidy" |
| 2 |
on: |
| 3 |
pull_request_target: |
| 4 |
types: [opened, ready_for_review, synchronize, reopened, labeled, unlabeled] |
| 5 |
branches: |
| 6 |
- main |
| 7 |
|
| 8 |
permissions: read-all |
| 9 |
|
| 10 |
jobs: |
| 11 |
setup-environment: |
| 12 |
permissions: |
| 13 |
contents: write # for Git to git push |
| 14 |
timeout-minutes: 30 |
| 15 |
runs-on: ubuntu-latest |
| 16 |
if: ${{ !contains(github.event.pull_request.labels.*.name, 'dependency-major-update') && (github.actor == 'renovate[bot]' || contains(github.event.pull_request.labels.*.name, 'renovatebot')) }} |
| 17 |
steps: |
| 18 |
- uses: actions/checkout@1af3b93b6815bc44a9784bd300feb67ff0d1eeb3 # v6.0.0 |
| 19 |
with: |
| 20 |
ref: ${{ github.head_ref }} |
| 21 |
- uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6.1.0 |
| 22 |
with: |
| 23 |
go-version: oldstable |
| 24 |
cache: false |
| 25 |
- name: Cache Go |
| 26 |
id: go-cache |
| 27 |
uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 |
| 28 |
with: |
| 29 |
path: | |
| 30 |
~/go/bin |
| 31 |
~/go/pkg/mod |
| 32 |
key: go-cache-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('**/go.sum') }} |
| 33 |
- name: Install dependencies |
| 34 |
if: steps.go-cache.outputs.cache-hit != 'true' |
| 35 |
run: make -j2 gomoddownload |
| 36 |
- name: go mod tidy |
| 37 |
run: | |
| 38 |
make gotidy |
| 39 |
git config user.name otelbot |
| 40 |
git config user.email [email protected] |
| 41 |
echo "git diff --exit-code || (git add . && git commit -m \"go mod tidy\" && git push)" |
| 42 |
git diff --exit-code || (git add . && git commit -m "go mod tidy" && git push) |
| 43 |
- uses: actions-ecosystem/action-remove-labels@2ce5d41b4b6aa8503e285553f75ed56e0a40bae0 # v1.3.0 |
| 44 |
with: |
| 45 |
labels: renovatebot |