Skip to content

Fix actionlint failure on generated maintenance workflow operation input - #56506

Merged
pelikhan merged 7 commits into
mainfrom
copilot/fix-agentics-maintenance-yml
Aug 28, 2026
Merged

Fix actionlint failure on generated maintenance workflow operation input#56506
pelikhan merged 7 commits into
mainfrom
copilot/fix-agentics-maintenance-yml

Conversation

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

The generated agentics-maintenance.yml workflow_dispatch.operation choice input used '' as both the default and an option, which actionlint rejects (string should not be empty). Removing the empty option alone just trades it for a different actionlint error, since the default then no longer matches any option.

Changes

  • Replace empty-string choice option with a none sentinelpkg/workflow/maintenance_workflow_yaml.go and pkg/workflow/side_repo_maintenance.go now emit 'none' as the workflow_dispatch choice default/option instead of ''. The workflow_call operation input stays a plain string with an empty-string default, since it isn't a choice and isn't subject to this restriction.
  • Treat '' and 'none' as equivalent "no operation" — added buildOperationIsEmptyCondition() / buildOperationIsNotEmptyCondition() helpers in pkg/workflow/maintenance_conditions.go so every generated if: condition (schedule-only jobs, run_operation, cleanup-cache-memory, etc.) recognizes both the workflow_call empty string and the workflow_dispatch sentinel as "nothing selected", instead of relying on a single empty-string check.
  • Consistent condition rendering — the "not empty" helper is built directly from != comparisons (rather than negating an OR), so run_operation's condition keeps the same != style as its other operation exclusion checks instead of mixing !(x == y) and x != y.
  • Regenerated agentics-maintenance.yml and updated the corresponding Go unit tests to match the new condition strings.

Before:

default: ''
options:
  - ''
  - 'disable'
  ...

After:

default: 'none'
options:
  - 'none'
  - 'disable'
  ...

Copilot AI and others added 2 commits August 28, 2026 04:31
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix actionlint errors in agentics-maintenance.yml Fix actionlint failure on generated maintenance workflow operation input Aug 28, 2026
Copilot AI requested a review from pelikhan August 28, 2026 04:39
@pelikhan
pelikhan marked this pull request as ready for review August 28, 2026 10:30
Copilot AI balanced review requested due to automatic review settings August 28, 2026 10:30

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Fixes invalid empty choice values in generated maintenance workflows while preserving no-operation behavior.

Changes:

  • Uses none as the dispatch sentinel.
  • Handles both none and empty workflow-call inputs.
  • Updates generated YAML and condition tests.
Show a summary per file
File Description
pkg/workflow/side_repo_maintenance.go Uses the sentinel for side-repository dispatch choices.
pkg/workflow/maintenance_workflow_yaml.go Emits a valid standard dispatch choice.
pkg/workflow/maintenance_conditions.go Centralizes no-operation condition handling.
pkg/workflow/maintenance_workflow_jobs_test.go Updates expected generated conditions.
.github/workflows/agentics-maintenance.yml Regenerates the maintenance workflow.

Review details

💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.

  • Files reviewed: 5/5 changed files
  • Comments generated: 0
  • Review effort level: Balanced

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

🧠 Matt Pocock Skills Reviewer has completed the skills-based review. ✅

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Test Quality Sentinel completed test quality analysis.

Test Quality Sentinel skipped because pre-fetch PR data was unavailable: unable to fetch test file diff

🧪 Test quality analysis by Test Quality Sentinel

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Design Decision Gate 🏗️ completed the design decision gate check. See the comment below for the result and any generated ADR draft.

No ADR enforcement needed: PR does not have the 'implementation' label and has <=100 new lines of code in business logic directories.

🏗️ ADR gate enforced by Design Decision Gate 🏗️

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

PR Code Quality Reviewer completed the code quality review.

🔎 Code quality review by PR Code Quality Reviewer

@github-actions

github-actions Bot commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

⚠️ Security scanning failed for Ponytail Reviewer. Review the logs for details.

Warning

Firewall blocked 4 domains

The following domains were blocked by the firewall during workflow execution:

  • ab.chatgpt.com
  • api.github.com
  • chatgpt.com
  • github.com

[!TIP]
api.github.com is blocked because GitHub API access uses the built-in GitHub tools by default. Instead of adding api.github.com to network.allowed, use tools.github.mode: gh-proxy for direct pre-authenticated GitHub CLI access without requiring network access to api.github.com:

tools:
  github:
    mode: gh-proxy

See GitHub Tools for more information on gh-proxy mode.

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"
    - "api.github.com"
    - "chatgpt.com"
    - "github.com"

See Network Configuration for more information.

Generated by Ponytail Reviewer for #56506

@github-actions

Copy link
Copy Markdown
Contributor

Comment Memory

reviewed_at: 2026-08-28T10:49:30Z
review_event: COMMENT
top_themes:
  - no actionable issues in sentinel migration
  - conditions updated consistently for workflow_dispatch and workflow_call
files_reviewed:
  - .github/workflows/agentics-maintenance.yml
  - pkg/workflow/maintenance_conditions.go
  - pkg/workflow/maintenance_workflow_jobs_test.go
  - pkg/workflow/maintenance_workflow_yaml.go
  - pkg/workflow/side_repo_maintenance.go
comment_count: 0

Note

This comment is managed by comment memory.

It stores persistent context for this thread in the code block at the top of this comment.
Edit only the text inside the backtick fences; workflow metadata and the footer are regenerated automatically.

Learn more about comment memory

🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 8.64 AIC · ⌖ 7.32 AIC · ⊞ 7K ·
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verdict

Non-blocking change. The none sentinel is wired through the generated conditions consistently, and I did not find a changed-line regression that would justify blocking merge.

Highlights
  • workflow_dispatch now emits a valid non-empty choice default.
  • The condition helpers preserve the old empty-string behavior for workflow_call while accepting the new dispatch sentinel.
  • Generated YAML and unit-test expectations were updated in sync.

🔎 Code quality review by PR Code Quality Reviewer · pi · gpt54 · 8.64 AIC · ⌖ 7.32 AIC · ⊞ 7K
Comment /review to run again

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The fix correctly replaces the empty-string choice option with 'none' as the sentinel value for inputs.operation, resolving the actionlint failure.

The approach is sound:

  • A named constant maintenanceNoOperationValue centralises the sentinel string.
  • Two helpers (buildOperationIsEmptyCondition / buildOperationIsNotEmptyCondition) encapsulate the dual-check, ensuring both workflow_call (which keeps default: '') and workflow_dispatch (which now defaults to 'none') are handled consistently.
  • The generated .yml, Go generator, and tests are all updated in lock-step.

No blocking issues found.

🧵 Reviewed using Impeccable skills by Impeccable Skills Reviewer · copilot · sonnet46 · 18.3 AIC · ⌖ 9.63 AIC · ⊞ 6.2K

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Skills-Based Review 🧠

Applied /diagnosing-bugs and /tdd — commenting (no blocking issues, but two improvements worth addressing).

📋 Key Themes & Highlights

Key Themes

  • Inconsistent string-building style: side_repo_maintenance.go uses raw + concatenation while the parallel function in maintenance_workflow_yaml.go uses fmt.Sprintf — a minor but real maintainability gap.
  • Missing unit tests for new helpers: buildOperationIsEmptyCondition / buildOperationIsNotEmptyCondition are untested directly; coverage depends on incidental string matching in integration-style tests.

Positive Highlights

  • ✅ Root cause is correctly addressed — the 'none' sentinel removes the actionlint violation without breaking workflow_call callers that still use an empty string.
  • ✅ Both conditions (isEmpty / isNotEmpty) are factored into named helpers rather than inlined in multiple call sites — good abstraction.
  • ✅ The isNotEmpty helper deliberately avoids negating an OR to preserve the != style already used in run_operation — consistent rendering.
  • ✅ Tests updated to match the new condition strings, and search-range constants bumped to accommodate the longer strings.

🧠 Reviewed using Matt Pocock's skills by Matt Pocock Skills Reviewer · copilot · sonnet46 · 25.9 AIC · ⌖ 11.7 AIC · ⊞ 7.6K
Comment /matt to run again

@@ -352,9 +352,9 @@ on:
description: 'Optional maintenance operation to run'
required: false
type: choice

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/diagnosing-bugs] String concatenation here is inconsistent with maintenance_workflow_yaml.go, which uses fmt.Sprintf + %[1]s for the same substitution. A future rename of maintenanceNoOperationValue could silently miss this spot.

💡 Suggested change

Adopt the same fmt.Sprintf pattern used in maintenance_workflow_yaml.go:

return fmt.Sprintf(`  workflow_dispatch:
    inputs:
      operation:
        ...
        default: '%[1]s'
        options:
          - '%[1]s'
`, maintenanceNoOperationValue)

This keeps the two YAML-building functions consistent and makes the substitution explicit.

@copilot please address this.

BuildStringLiteral(""),
),
BuildEquals(
BuildPropertyAccess("inputs.operation"),

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[/tdd] The two new helpers buildOperationIsEmptyCondition and buildOperationIsNotEmptyCondition have no direct unit tests. Coverage currently comes only from the integration-style string-match tests in maintenance_workflow_jobs_test.go, which means a logic error inside either helper (e.g. swapping BuildOr for BuildAnd) would produce a wrong condition string that the existing tests would catch only incidentally.

💡 Suggested test

Add a small table-driven test in maintenance_conditions_test.go (or equivalent):

func TestBuildOperationIsEmptyCondition(t *testing.T) {
    node := buildOperationIsEmptyCondition()
    got := renderCondition(node) // use whatever renderer is available
    want := `inputs.operation == '' || inputs.operation == 'none'`
    require.Equal(t, want, got)
}

func TestBuildOperationIsNotEmptyCondition(t *testing.T) {
    node := buildOperationIsNotEmptyCondition()
    got := renderCondition(node)
    want := `inputs.operation != '' && inputs.operation != 'none'`
    require.Equal(t, want, got)
}

This gives a regression anchor directly on the helpers and documents their intended output as a specification.

@copilot please address this.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This helper layer is a bit heavier than the feature needs; inline the inputs.operation checks directly at the two call sites and keep the sentinel constant local to the workflow change. net: -10 lines possible.

Warning

Firewall blocked 4 domains

The following domains were blocked by the firewall during workflow execution:

  • ab.chatgpt.com
  • api.github.com
  • chatgpt.com
  • github.com

[!TIP]
api.github.com is blocked because GitHub API access uses the built-in GitHub tools by default. Instead of adding api.github.com to network.allowed, use tools.github.mode: gh-proxy for direct pre-authenticated GitHub CLI access without requiring network access to api.github.com:

tools:
  github:
    mode: gh-proxy

See GitHub Tools for more information on gh-proxy mode.

To allow these domains, add them to the network.allowed list in your workflow frontmatter:

network:
  allowed:
    - defaults
    - "ab.chatgpt.com"
    - "api.github.com"
    - "chatgpt.com"
    - "github.com"

See Network Configuration for more information.

Generated by ✂️ Ponytail Reviewer for #56506 · codex · mai10 · 8.99 AIC · ⌖ 0.266 AIC · ⊞ 12.8K
Comment /ponytail to run again

// `inputs.operation` value represents "no operation selected", i.e. it is
// either an empty string (workflow_call default) or the choice sentinel value
// used by the workflow_dispatch "operation" input.
func buildOperationIsEmptyCondition() ConditionNode {

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pkg/workflow/maintenance_conditions.go:16-50: yagni: two tiny helpers for one extra / branch. Inline the comparisons directly at the call sites.

@github github deleted a comment from frankly7858-oss Aug 28, 2026
@pelikhan

Copy link
Copy Markdown
Collaborator

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@pelikhan Unfortunately I hit an unexpected error while processing your comment. I've automatically reported this to GitHub.

You can ask me to try again later by mentioning me in a new comment.

If you want to contact GitHub about this error, please mention the following identifier so they can better serve you: e648920c-eaf5-4177-a2fe-c8dcfe9f5a73

Sorry for the inconvenience!

Copilot AI and others added 2 commits August 28, 2026 13:51
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
This reverts commit 88cc94a.

Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Copilot AI and others added 2 commits August 28, 2026 13:56
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>
Co-authored-by: pelikhan <4175913+pelikhan@users.noreply.github.com>

Copilot AI commented Aug 28, 2026

Copy link
Copy Markdown
Contributor Author

@copilot fix lint go

https://github.com/github/gh-aw/actions/runs/33163612274/job/98826912362

Fixed Go formatting in f538699 and clarified the formatter-safe comment in e35c551. make agent-report-progress and go test ./pkg/workflow -count=1 pass.

@pelikhan
pelikhan merged commit f7b6077 into main Aug 28, 2026
32 checks passed
@pelikhan
pelikhan deleted the copilot/fix-agentics-maintenance-yml branch August 28, 2026 16:20

@lkraav lkraav left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@github-actions

Copy link
Copy Markdown
Contributor

🎉 This pull request is included in a new release.

Release: v0.87.9

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0.86.2: generated agentics-maintenance.yml fails actionlint

4 participants