Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci-autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout failed branch
uses: actions/checkout@v4
uses: actions/checkout@v5
with:
ref: ${{ github.event.workflow_run.head_branch }}

Expand All @@ -40,7 +40,7 @@ jobs:

- name: Set up Go
if: steps.freshness.outputs.should_skip != 'true'
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: go.mod

Expand All @@ -56,7 +56,7 @@ jobs:
id: golangci_autofix
if: steps.freshness.outputs.should_skip != 'true'
continue-on-error: true
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
version: v2.11.3
args: --fix
Expand Down
23 changes: 7 additions & 16 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,22 +16,13 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: go.mod

- name: Cache Go modules
uses: actions/cache@v4
with:
path: |
~/.cache/go-build
~/go/pkg/mod
key: ${{ runner.os }}-go-${{ hashFiles('**/go.sum') }}
restore-keys: |
${{ runner.os }}-go-
cache: true

- name: Download dependencies
run: go mod download
Expand All @@ -46,15 +37,15 @@ jobs:
fi

- name: Run golangci-lint
uses: golangci/golangci-lint-action@v7
uses: golangci/golangci-lint-action@v8
with:
version: v2.11.3

- name: Run tests
run: go test -race -coverprofile=coverage.out ./...

- name: Run go vet
run: go vet ./...

- name: Build
run: go build ./...

- name: Run tests
run: go test -race -coverprofile=coverage.out ./...
2 changes: 1 addition & 1 deletion .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Setup Pages
uses: actions/configure-pages@v5
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,10 @@ jobs:

steps:
- name: Checkout
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set up Go
uses: actions/setup-go@v5
uses: actions/setup-go@v6
with:
go-version-file: go.mod

Expand Down Expand Up @@ -95,7 +95,7 @@ jobs:

- name: Checkout
if: steps.tap-secret.outputs.configured == 'true'
uses: actions/checkout@v4
uses: actions/checkout@v5

- name: Set version from tag
if: steps.tap-secret.outputs.configured == 'true'
Expand Down
12 changes: 11 additions & 1 deletion internal/publish/publish_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,18 @@ import (
)

func TestSyncGitRepositoryExistingRepoPreservesRemoteFiles(t *testing.T) {
// syncGitRepository commits in its own clone, so the identity must come
// from the environment rather than per-repo config; CI runners have no
// global git identity.
t.Setenv("GIT_AUTHOR_NAME", "climate")
t.Setenv("GIT_AUTHOR_EMAIL", "climate@example.test")
t.Setenv("GIT_COMMITTER_NAME", "climate")
t.Setenv("GIT_COMMITTER_EMAIL", "climate@example.test")

remoteBare := filepath.Join(t.TempDir(), "remote.git")
if err := runGit("", "init", "--bare", remoteBare); err != nil {
// --initial-branch pins the bare repo's HEAD to main; otherwise it depends
// on the machine's init.defaultBranch and clones may check out nothing.
if err := runGit("", "init", "--bare", "--initial-branch=main", remoteBare); err != nil {
t.Fatalf("init bare repo: %v", err)
}

Expand Down
Loading