Skip to content

Commit e0daa2e

Browse files
Copilotintel352
andauthored
fix: address code review feedback - permissions, separator, release URL versioning
- Add permissions: contents: read to wfctl-strict-contracts CI job (CodeQL fix) - Replace null byte (\x00) key separator with colon (:) in plugin_test.go - Add goreleaser hook to auto-update download URLs version on release Agent-Logs-Url: https://github.com/GoCodeAlone/workflow-plugin-data-engineering/sessions/18d98b1e-7eba-4f0f-8446-bc1fbffb2c53 Co-authored-by: intel352 <77607+intel352@users.noreply.github.com>
1 parent cf83007 commit e0daa2e

3 files changed

Lines changed: 6 additions & 3 deletions

File tree

.github/workflows/ci.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@ jobs:
2828

2929
wfctl-strict-contracts:
3030
runs-on: ubuntu-latest
31+
permissions:
32+
contents: read
3133
steps:
3234
- uses: actions/checkout@v4
3335

.goreleaser.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ before:
44
hooks:
55
- go mod tidy
66
- "sed -i.bak 's/\"version\": \".*\"/\"version\": \"{{ .Version }}\"/' plugin.json && rm -f plugin.json.bak"
7+
- "sed -i.bak 's|/releases/download/v[0-9][0-9]*\\.[0-9][0-9]*\\.[0-9][0-9]*/|/releases/download/v{{ .Version }}/|g' plugin.json && rm -f plugin.json.bak"
78

89
builds:
910
- id: workflow-plugin-data-engineering

internal/plugin_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -657,15 +657,15 @@ func TestPlugin_ModuleContractCoverage(t *testing.T) {
657657
// Index contracts by kind+type.
658658
byKindType := make(map[string]bool, len(cf.Contracts))
659659
for _, d := range cf.Contracts {
660-
byKindType[d.Kind+"\x00"+d.Type] = true
660+
byKindType[d.Kind+":"+d.Type] = true
661661
}
662662

663663
p := newPlugin(t)
664664

665665
// Every advertised module type must have a contract entry.
666666
missing := []string{}
667667
for _, mt := range p.ModuleTypes() {
668-
if !byKindType["module\x00"+mt] {
668+
if !byKindType["module:"+mt] {
669669
missing = append(missing, mt)
670670
}
671671
}
@@ -677,7 +677,7 @@ func TestPlugin_ModuleContractCoverage(t *testing.T) {
677677
// Every advertised trigger type must have a contract entry.
678678
missingTrigger := []string{}
679679
for _, tt := range p.TriggerTypes() {
680-
if !byKindType["trigger\x00"+tt] {
680+
if !byKindType["trigger:"+tt] {
681681
missingTrigger = append(missingTrigger, tt)
682682
}
683683
}

0 commit comments

Comments
 (0)