Skip to content

Commit 75fdbe6

Browse files
SEC-090: Automated trusted workflow pinning (2025-04-07) (#332)
* Result of tsccr-helper -log-level=info gha update -latest .github/ * golangci-lint migrate * Un-flip tables --------- Co-authored-by: hashicorp-tsccr[bot] <hashicorp-tsccr[bot]@users.noreply.github.com> Co-authored-by: Baraa Basata <[email protected]>
1 parent c6dff0c commit 75fdbe6

File tree

4 files changed

+38
-32
lines changed

4 files changed

+38
-32
lines changed

.github/workflows/test.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -21,13 +21,13 @@ jobs:
2121
timeout-minutes: 5
2222
steps:
2323
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
24-
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
24+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
2525
with:
2626
go-version-file: 'go.mod'
2727
id: go
2828

2929
- name: Run linters
30-
uses: golangci/golangci-lint-action@4696ba8babb6127d732c3c6dde519db15edab9ea # v6.5.1
30+
uses: golangci/golangci-lint-action@1481404843c368bc19ca9406f87d6e0fc97bdcfd # v7.0.0
3131
with:
3232
version: latest
3333

@@ -55,7 +55,7 @@ jobs:
5555
terraform: ${{ fromJSON(vars.TF_VERSIONS_PROTOCOL_V5) }}
5656
steps:
5757
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
58-
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
58+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
5959
with:
6060
go-version-file: 'go.mod'
6161
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2
@@ -86,7 +86,7 @@ jobs:
8686
terraform: ${{ fromJSON(vars.TF_VERSIONS_PROTOCOL_V6) }}
8787
steps:
8888
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
89-
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.0
89+
- uses: actions/setup-go@0aaccfd150d50ccaeb58ebd88d36e91967a5f35b # v5.4.0
9090
with:
9191
go-version-file: 'go.mod'
9292
- uses: hashicorp/setup-terraform@b9cd54a3c349d3f38e8881555d616ced269862dd # v3.1.2

.golangci.yml

Lines changed: 32 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,11 @@
1-
issues:
2-
max-issues-per-linter: 0
3-
max-same-issues: 0
4-
1+
version: "2"
52
linters:
6-
disable-all: true
3+
default: none
74
enable:
85
- copyloopvar
96
- durationcheck
107
- errcheck
118
- forcetypeassert
12-
- gofmt
13-
- gosimple
149
- govet
1510
- ineffassign
1611
- makezero
@@ -22,7 +17,33 @@ linters:
2217
- unparam
2318
- unused
2419
- usetesting
25-
26-
run:
27-
# Prevent false positive timeouts in CI
28-
timeout: 5m
20+
exclusions:
21+
generated: lax
22+
presets:
23+
- comments
24+
- common-false-positives
25+
- legacy
26+
- std-error-handling
27+
paths:
28+
- third_party$
29+
- builtin$
30+
- examples$
31+
settings:
32+
staticcheck:
33+
checks:
34+
- all
35+
- '-QF1011' # could omit type *schema.Provider from declaration -- https://staticcheck.dev/docs/checks/#QF1011
36+
- '-ST1003' # example: "const autoTFVarsJson should be autoTFVarsJSON" -- https://staticcheck.dev/docs/checks/#ST1003
37+
- '-ST1005' # "error strings should not end with punctuation or newlines" -- https://staticcheck.dev/docs/checks/#ST1005
38+
issues:
39+
max-issues-per-linter: 0
40+
max-same-issues: 0
41+
formatters:
42+
enable:
43+
- gofmt
44+
exclusions:
45+
generated: lax
46+
paths:
47+
- third_party$
48+
- builtin$
49+
- examples$

internal/framework5provider/identity_resource_test.go

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,8 @@ import (
1818

1919
func TestIdentityResource(t *testing.T) {
2020
resource.UnitTest(t, resource.TestCase{
21-
// Latest alpha version that this JSON data is available in
22-
// https://github.com/hashicorp/terraform/releases/tag/v1.12.0-alpha20250319
2321
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
24-
tfversion.SkipBelow(version.Must(version.NewVersion("1.12.0-alpha20250319"))),
22+
tfversion.SkipBelow(version.Must(version.NewVersion("1.12.0-beta1"))),
2523
},
2624
ProtoV5ProviderFactories: map[string]func() (tfprotov5.ProviderServer, error){
2725
"framework": providerserver.NewProtocol5WithError(New()),

internal/framework6provider/identity_resource_test.go

Lines changed: 1 addition & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
package framework
55

66
import (
7-
"regexp"
87
"testing"
98

109
"github.com/hashicorp/go-version"
@@ -19,10 +18,8 @@ import (
1918

2019
func TestIdentityResource(t *testing.T) {
2120
resource.UnitTest(t, resource.TestCase{
22-
// Latest alpha version that this JSON data is available in
23-
// https://github.com/hashicorp/terraform/releases/tag/v1.12.0-alpha20250319
2421
TerraformVersionChecks: []tfversion.TerraformVersionCheck{
25-
tfversion.SkipBelow(version.Must(version.NewVersion("1.12.0-alpha20250319"))),
22+
tfversion.SkipBelow(version.Must(version.NewVersion("1.12.0-beta1"))),
2623
},
2724
ProtoV6ProviderFactories: map[string]func() (tfprotov6.ProviderServer, error){
2825
"framework": providerserver.NewProtocol6WithError(New()),
@@ -38,11 +35,6 @@ func TestIdentityResource(t *testing.T) {
3835
"name": knownvalue.StringExact("my name is john"),
3936
}),
4037
},
41-
// TODO: This is definitely not the expected behavior, so this line should be removed once the next alpha of
42-
// Terraform core is released with this bug fix: https://github.com/hashicorp/terraform/pull/36756
43-
//
44-
// (╯°□°)╯︵ ┻━┻ => ┬─┬ノ( º _ ºノ)
45-
ExpectError: regexp.MustCompile(`!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!`),
4638
},
4739
{
4840
Config: `resource "framework_identity" "test" {
@@ -59,11 +51,6 @@ func TestIdentityResource(t *testing.T) {
5951
"name": knownvalue.StringExact("my name is john"), // doesn't get updated, since identity should not change.
6052
}),
6153
},
62-
// TODO: This is definitely not the expected behavior, so this line should be removed once the next alpha of
63-
// Terraform core is released with this bug fix: https://github.com/hashicorp/terraform/pull/36756
64-
//
65-
// (╯°□°)╯︵ ┻━┻ => ┬─┬ノ( º _ ºノ)
66-
ExpectError: regexp.MustCompile(`!!!!!!!!!!!!!!!!!!!!!!!!!!! TERRAFORM CRASH !!!!!!!!!!!!!!!!!!!!!!!!!!!!`),
6754
},
6855
},
6956
})

0 commit comments

Comments
 (0)