Skip to content

chore(deps): golang.org/x/text ^ v0.37.0 (#1261) #3

chore(deps): golang.org/x/text ^ v0.37.0 (#1261)

chore(deps): golang.org/x/text ^ v0.37.0 (#1261) #3

name: Sync gomod2nix.toml
on:
push:
branches: [master]
paths:
- go.mod
- go.sum
workflow_dispatch:
permissions:
contents: write
pull-requests: write
jobs:
sync:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6
- name: Install Nix
uses: cachix/install-nix-action@8aa03977d8d733052d78f4e008a241fd1dbf36b3 # v31
with:
nix_path: nixpkgs=channel:nixpkgs-unstable
- name: Generate gomod2nix.toml
run: nix develop --command gomod2nix generate
- name: Create Pull Request
env:
GH_TOKEN: ${{ secrets.HOMEBREW_GITHUB_TOKEN }}
run: |
git diff --quiet gomod2nix.toml && exit 0
BRANCH="chore/sync-gomod2nix"
git config user.name "Floatpane Bot"
git config user.email "us@floatpane.com"
git checkout -b "$BRANCH"
git add gomod2nix.toml
git commit -m "chore: sync gomod2nix.toml"
git push -f origin "$BRANCH"
if ! gh pr list --head "$BRANCH" --state open | grep -q .; then
BODY=$(cat <<'EOF'
## What?
Regenerates `gomod2nix.toml` to reflect the current `go.mod` / `go.sum`.
## Why?
Keeps the Nix build in sync with Go module changes. Without this, `nix build` fails when new or upgraded Go deps are missing from `gomod2nix.toml`. Generated automatically by the gomod2nix sync workflow.
EOF
)
gh pr create --title "chore: sync gomod2nix.toml" --body "$BODY" --base master --label chore --label area/nix
fi