Skip to content

Imported safe-outputs block re-enables missing-tool, missing-data and report-incomplete disabled in the main workflow #64542

Closed

Description

@cristiano-turba

Summary

Importing a shared workflow that has any safe-outputs block re-enables missing-tool, missing-data and report-incomplete even when the main workflow sets them to false.
The re-enabled handlers add their agent tools and create-issue: true reporting to the compiled workflow.

The docs say local configuration overrides imported configuration, so an explicit false in the main workflow should win.

Versions

  • gh-aw v0.89.22
  • The merge code in pkg/workflow/imports.go is unchanged on main (856e7fa).

Reproduction

.github/workflows/shared/footer.md:

---
safe-outputs:
  messages:
    footer: "> custom footer"
---

.github/workflows/with-import.md:

---
on: workflow_dispatch
permissions:
  contents: read
imports:
  - shared/footer.md
engine: claude
safe-outputs:
  missing-tool: false
  missing-data: false
  report-incomplete: false
  noop:
---
hi

.github/workflows/no-import.md: identical without imports:.

gh aw compile --no-check-update

Safe-output tools in the compiled prompt:

with-import: Tools: create_issue, missing_tool, missing_data, noop
no-import:   Tools: create_issue, noop

with-import.lock.yml also gets GH_AW_MISSING_TOOL_CREATE_ISSUE: "true" and GH_AW_REPORT_INCOMPLETE_CREATE_ISSUE: "true".

In a real workflow that uses safe-outputs.github-app, this also adds permission-issues: write to the App token request, and the run fails when the App installation doesn't grant issues: The permissions requested are not granted to this installation.

Cause

mergeSafeOutputConfig (pkg/workflow/imports.go):

_, hasMissingTool := config["missing-tool"]
if (hasMissingTool || result.MissingTool == nil) && importedConfig.MissingTool != nil {
	result.MissingTool = importedConfig.MissingTool
}

missing-tool: false in the main workflow leaves result.MissingTool nil.
extractSafeOutputsConfig auto-defaults importedConfig.MissingTool because the import has a safe-outputs block, even though the import never mentions missing-tool.
The result.MissingTool == nil arm cannot tell "disabled by the main workflow" from "not configured", so the auto-default replaces the explicit false.
missing-data and report-incomplete follow the same pattern.

Workaround

Keep safe-outputs out of shared imports and put the settings, such as messages, in each main workflow.

Expected

An explicit false in the main workflow survives the merge, and an auto-default from an import never overrides a key the main workflow set.

Activity

  1. locked and limited conversation to collaborators on Sep 30, 2026
  2. unlocked this conversation on Sep 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions