Update module golang.org/x/tools to v0.46.0 #17
Workflow file for this run
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: update-vendor-hash | |
| # Renovate updates go.mod / go.sum but cannot update the vendorHash in | |
| # flake.nix, which causes the Nix build to fail until the hash is fixed by | |
| # hand. This workflow watches Renovate PRs that modify the Go module files, | |
| # recomputes the vendorHash with `nix-update`, and pushes the corrected | |
| # flake.nix back to the PR branch using a GitHub App token. We can't just | |
| # use the regular token as it wouldn't re-trigger GitHub actions. | |
| # | |
| # Setup (one-time) | |
| # ---------------- | |
| # 1. Create a GitHub App (Settings → Developer settings → GitHub Apps). | |
| # Disable webhooks. Repository permissions: | |
| # - Contents: Read & write | |
| # - Metadata: Read | |
| # 2. Generate a private key (.pem) and install the App on this repository. | |
| # 3. In repository settings: | |
| # - Add a *variable* RENOVATE_FIX_APP_ID = <numeric app id> | |
| # - Add a *secret* RENOVATE_FIX_APP_PRIVATE_KEY = <pem contents> | |
| on: | |
| pull_request: | |
| paths: | |
| - go.mod | |
| - go.sum | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} | |
| cancel-in-progress: true | |
| jobs: | |
| update: | |
| if: github.event.pull_request.head.repo.full_name == github.repository | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Generate GitHub App token | |
| id: app-token | |
| uses: actions/create-github-app-token@v3 | |
| with: | |
| app-id: ${{ vars.RENOVATE_FIX_APP_ID }} | |
| private-key: ${{ secrets.RENOVATE_FIX_APP_PRIVATE_KEY }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ github.event.pull_request.head.ref }} | |
| token: ${{ steps.app-token.outputs.token }} | |
| - uses: DeterminateSystems/nix-installer-action@v22 | |
| with: | |
| summarize: false | |
| - uses: DeterminateSystems/magic-nix-cache-action@v14 | |
| - name: Recompute vendorHash with nix-update | |
| run: nix run github:Mic92/nix-update -- --flake --version=skip scip-go | |
| - name: Commit and push | |
| run: | | |
| set -euo pipefail | |
| if git diff --quiet flake.nix; then | |
| echo "vendorHash unchanged; nothing to push." | |
| exit 0 | |
| fi | |
| git config user.name 'github-actions[bot]' | |
| git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
| git add flake.nix | |
| git commit -m 'chore: update vendorHash for go.mod changes' | |
| git push |