build(deps): update opentelemetry-deps-collector #2613
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Renovate Post-Update Tasks / Go | |
| on: | |
| pull_request: | |
| types: [opened, synchronize, edited] | |
| paths: | |
| - '**/go.mod' | |
| branches: | |
| - main | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| jobs: | |
| gomodtidy: | |
| # Only run on Renovate PRs | |
| if: startsWith(github.head_ref, 'renovate/') | |
| runs-on: ubuntu-24.04 | |
| steps: | |
| - name: Create otelbot app token | |
| if: ${{ github.event.pull_request.head.repo.fork == false }} | |
| uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0 | |
| id: app-token | |
| with: | |
| client-id: ${{ vars.OTELBOT_LAMBDA_CLIENT_ID }} | |
| private-key: ${{ secrets.OTELBOT_LAMBDA_PRIVATE_KEY }} | |
| permission-contents: write | |
| - name: Fork checkout | |
| if: ${{ github.event.pull_request.head.repo.fork == false }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| ref: ${{ github.head_ref }} | |
| token: ${{ steps.app-token.outputs.token }} | |
| # zizmor: ignore[artipacked] Credentials are required by the Renovate branch push below. | |
| persist-credentials: true | |
| - name: Local checkout | |
| if: ${{ github.event.pull_request.head.repo.fork == true }} | |
| uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - uses: actions/setup-go@b7ad1dad31e06c5925ef5d2fc7ad053ef454303e # v7.0.0 | |
| with: | |
| go-version-file: collector/go.mod | |
| - run: find . -name "go.mod" -execdir go mod tidy \; | |
| - name: Check if go mod changed | |
| id: check_changes | |
| env: | |
| BASE_REF: ${{ github.base_ref }} | |
| run: | | |
| git fetch origin "$BASE_REF" | |
| if git diff --name-only "origin/$BASE_REF" HEAD \ | |
| | grep -E '^(.*/)?go\.(mod|sum)$' >/dev/null; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Commit and push changes | |
| if: steps.check_changes.outputs.changed == 'true' | |
| run: | | |
| git config user.name otelbot[bot] | |
| git config user.email 197425009+otelbot[bot]@users.noreply.github.com | |
| git add collector/ | |
| if git diff --staged --quiet; then | |
| echo "No changes to commit" | |
| else | |
| git commit -m "chore: go mod tidy" | |
| git push | |
| fi |