Skip to content

Commit 523efdf

Browse files
SEC-090: Automated trusted workflow pinning (2024-08-19) (#601)
* Result of tsccr-helper -log-level=info gha update -latest . * Resolve linter errors and warnings --------- Co-authored-by: hashicorp-tsccr[bot] <hashicorp-tsccr[bot]@users.noreply.github.com> Co-authored-by: Selena Goods <[email protected]>
1 parent b6364da commit 523efdf

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ jobs:
8989
cd .changes
9090
sed -e "1{/# /d;}" -e "2{/^$/d;}" ${{ needs.changelog-version.outputs.version }}.md > release-notes.txt
9191
92-
- uses: actions/upload-artifact@89ef406dd8d7e03cfd12d9e0a4a378f454709029 # v4.3.5
92+
- uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # v4.3.6
9393
with:
9494
name: release-notes
9595
path: ./.changes/release-notes.txt

.golangci.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ linters:
2222
- unconvert
2323
- unparam
2424
- unused
25-
- vet
25+
- govet
2626

2727
run:
2828
# Prevent false positive timeouts in CI

internal/provider/resource_integer.go

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -101,26 +101,26 @@ func (r *integerResource) Create(ctx context.Context, req resource.CreateRequest
101101
return
102102
}
103103

104-
max := int(plan.Max.ValueInt64())
105-
min := int(plan.Min.ValueInt64())
104+
maxVal := int(plan.Max.ValueInt64())
105+
minVal := int(plan.Min.ValueInt64())
106106
seed := plan.Seed.ValueString()
107107

108-
if max < min {
108+
if maxVal < minVal {
109109
resp.Diagnostics.AddError(
110110
"Create Random Integer Error",
111-
"The minimum (min) value needs to be smaller than or equal to maximum (max) value.",
111+
"The minimum (minVal) value needs to be smaller than or equal to maximum (maxVal) value.",
112112
)
113113
return
114114
}
115115

116116
rand := random.NewRand(seed)
117-
number := rand.Intn((max+1)-min) + min
117+
number := rand.Intn((maxVal+1)-minVal) + minVal
118118

119119
u := &integerModelV0{
120120
ID: types.StringValue(strconv.Itoa(number)),
121121
Keepers: plan.Keepers,
122-
Min: types.Int64Value(int64(min)),
123-
Max: types.Int64Value(int64(max)),
122+
Min: types.Int64Value(int64(minVal)),
123+
Max: types.Int64Value(int64(maxVal)),
124124
Result: types.Int64Value(int64(number)),
125125
}
126126

@@ -179,7 +179,7 @@ func (r *integerResource) ImportState(ctx context.Context, req resource.ImportSt
179179
return
180180
}
181181

182-
min, err := strconv.ParseInt(parts[1], 10, 64)
182+
minVal, err := strconv.ParseInt(parts[1], 10, 64)
183183
if err != nil {
184184
resp.Diagnostics.AddError(
185185
"Import Random Integer Error",
@@ -189,7 +189,7 @@ func (r *integerResource) ImportState(ctx context.Context, req resource.ImportSt
189189
return
190190
}
191191

192-
max, err := strconv.ParseInt(parts[2], 10, 64)
192+
maxVal, err := strconv.ParseInt(parts[2], 10, 64)
193193
if err != nil {
194194
resp.Diagnostics.AddError(
195195
"Import Random Integer Error",
@@ -204,8 +204,8 @@ func (r *integerResource) ImportState(ctx context.Context, req resource.ImportSt
204204
state.ID = types.StringValue(parts[0])
205205
state.Keepers = types.MapNull(types.StringType)
206206
state.Result = types.Int64Value(result)
207-
state.Min = types.Int64Value(min)
208-
state.Max = types.Int64Value(max)
207+
state.Min = types.Int64Value(minVal)
208+
state.Max = types.Int64Value(maxVal)
209209

210210
if len(parts) == 4 {
211211
state.Seed = types.StringValue(parts[3])

0 commit comments

Comments
 (0)