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
22 changes: 11 additions & 11 deletions pkg/workflow/action_pins_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ func TestApplyActionPinToStep(t *testing.T) {
"uses": "actions/checkout@v5",
},
expectPinned: true,
expectedUses: "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5",
expectedUses: "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1",
},
{
name: "step with pinned action (setup-node)",
Expand All @@ -276,7 +276,7 @@ func TestApplyActionPinToStep(t *testing.T) {
},
},
expectPinned: true,
expectedUses: "actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6",
expectedUses: "actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0",
},
{
name: "step with unpinned action",
Expand All @@ -303,7 +303,7 @@ func TestApplyActionPinToStep(t *testing.T) {
"uses": "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd",
},
expectPinned: true,
expectedUses: "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5",
expectedUses: "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1",
},
}

Expand Down Expand Up @@ -345,9 +345,9 @@ func TestApplyActionPinToStep(t *testing.T) {
func TestGetActionPinsSorting(t *testing.T) {
pins := getActionPins()

// Verify we got all the pins (should be 28 after adding super-linter v8.2.1)
if len(pins) != 28 {
t.Errorf("getActionPins() returned %d pins, expected 28", len(pins))
// Verify we got all the pins (should be 37 after adding specific version entries)
if len(pins) != 37 {
t.Errorf("getActionPins() returned %d pins, expected 37", len(pins))
}

// Verify they are sorted by version (descending) then by repository name (ascending)
Expand Down Expand Up @@ -387,13 +387,13 @@ func TestGetActionPinByRepo(t *testing.T) {
repo: "actions/checkout",
expectExists: true,
expectRepo: "actions/checkout",
expectVer: "v5",
expectVer: "v5.0.1",
},
{
repo: "actions/setup-node",
expectExists: true,
expectRepo: "actions/setup-node",
expectVer: "v6",
expectVer: "v6.1.0",
},
{
repo: "unknown/action",
Expand Down Expand Up @@ -443,7 +443,7 @@ func TestApplyActionPinToTypedStep(t *testing.T) {
Uses: "actions/checkout@v5",
},
expectPinned: true,
expectedUses: "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5",
expectedUses: "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1",
},
{
name: "step with pinned action (setup-node)",
Expand All @@ -455,7 +455,7 @@ func TestApplyActionPinToTypedStep(t *testing.T) {
},
},
expectPinned: true,
expectedUses: "actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6",
expectedUses: "actions/setup-node@395ad3262231945c25e8478fd5baf05154b1d79f # v6.1.0",
},
{
name: "step with unpinned action",
Expand Down Expand Up @@ -495,7 +495,7 @@ func TestApplyActionPinToTypedStep(t *testing.T) {
},
},
expectPinned: true,
expectedUses: "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5",
expectedUses: "actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1",
},
}

Expand Down
26 changes: 0 additions & 26 deletions pkg/workflow/compiler_parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -769,32 +769,6 @@ func (c *Compiler) copyFrontmatterWithoutInternalMarkers(frontmatter map[string]
return copy
}

// removeInternalMarkers removes internal marker fields from frontmatter that are used for
// internal processing but should not be validated against the schema
func (c *Compiler) removeInternalMarkers(frontmatter map[string]any) {
// Check if "on" field exists
onValue, exists := frontmatter["on"]
if !exists {
return
}

// Check if "on" is a map
onMap, ok := onValue.(map[string]any)
if !ok {
return
}

// Process issues and pull_request sections
for _, sectionKey := range []string{"issues", "pull_request"} {
if sectionValue, hasSec := onMap[sectionKey]; hasSec {
if sectionMap, ok := sectionValue.(map[string]any); ok {
// Remove the marker field
delete(sectionMap, "__gh_aw_native_label_filter__")
}
}
}
}

// detectTextOutputUsage checks if the markdown content uses ${{ needs.activation.outputs.text }}
func (c *Compiler) detectTextOutputUsage(markdownContent string) bool {
// Check for the specific GitHub Actions expression
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/runtime_setup_integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ steps:
# Test workflow`,
expectSetup: []string{
"Setup uv",
"astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081",
"astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86",
},
},
{
Expand Down
6 changes: 3 additions & 3 deletions pkg/workflow/runtime_setup_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -318,7 +318,7 @@ func TestGenerateRuntimeSetupSteps(t *testing.T) {
expectSteps: 1,
checkContent: []string{
"Setup uv",
"astral-sh/setup-uv@e58605a9b6da7c637471fab8847a5e5a6b8df081",
"astral-sh/setup-uv@d4b2f3b6ecc6e67c4457f6d3e41ec42d3d0fcb86",
},
},
{
Expand Down Expand Up @@ -354,7 +354,7 @@ func TestGenerateRuntimeSetupSteps(t *testing.T) {
expectSteps: 1,
checkContent: []string{
"Setup Elixir",
"erlef/setup-beam@3559ac3b631a9560f28817e8e7fdde1638664336",
"erlef/setup-beam@dff508cca8ce57162e7aa6c4769a4f97c2fed638",
"elixir-version: '1.17'",
},
},
Expand All @@ -366,7 +366,7 @@ func TestGenerateRuntimeSetupSteps(t *testing.T) {
expectSteps: 1,
checkContent: []string{
"Setup Haskell",
"haskell-actions/setup@0b77b13e8a0f222da982de80f02d94f9c058a6ba",
"haskell-actions/setup@782a7c5aa54495c3d21d7c8d5f03a8a2113a1ff7",
"ghc-version: '9.10'",
},
},
Expand Down