Skip to content
Closed
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
25 changes: 25 additions & 0 deletions .github/aw/actions-lock.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"version": "v5.0.2",
"sha": "8b402f58fbc84540c8b491a91e594a4576fec3d7"
},
"actions/checkout@v5": {
"repo": "actions/checkout",
"version": "v5",
"sha": "93cb6efe18208431cddfb8368fd83d5badbf9bfd"
},
"actions/checkout@v6.0.2": {
"repo": "actions/checkout",
"version": "v6.0.2",
Expand All @@ -35,11 +40,21 @@
"version": "v3.0.0-beta.2",
"sha": "bf559f85448f9380bcfa2899dbdc01eb5b37be3a"
},
"actions/download-artifact@v6": {
"repo": "actions/download-artifact",
"version": "v6",
"sha": "018cc2cf5baa6db3ef3c5f8a56943fffe632ef53"
},
"actions/download-artifact@v7": {
"repo": "actions/download-artifact",
"version": "v7",
"sha": "37930b1c2abaa49bbe596cd826c3c89aef350131"
},
"actions/github-script@v7": {
"repo": "actions/github-script",
"version": "v7",
"sha": "f28e40c7f34bde8b3046d885e986cb6290c5673b"
},
"actions/github-script@v8": {
"repo": "actions/github-script",
"version": "v8",
Expand Down Expand Up @@ -125,6 +140,11 @@
"version": "v4.32.0",
"sha": "e6985fd516cce3b1a0e8db34a4013d2e50a1e252"
},
"github/stale-repos@v3": {
"repo": "github/stale-repos",
"version": "v3",
"sha": "3477b6488008d9411aaf22a0924ec7c1f6a69980"
},
"github/stale-repos@v8.0.4": {
"repo": "github/stale-repos",
"version": "v8.0.4",
Expand All @@ -145,6 +165,11 @@
"version": "v1.286.0",
"sha": "90be1154f987f4dc0fe0dd0feedac9e473aa4ba8"
},
"super-linter/super-linter@v8.2.1": {
"repo": "super-linter/super-linter",
"version": "v8.2.1",
"sha": "2bdd90ed3262e023ac84bf8fe35dc480721fc1f2"
},
"super-linter/super-linter@v8.3.2": {
"repo": "super-linter/super-linter",
"version": "v8.3.2",
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/agentics-maintenance.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ jobs:
issues: write
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
actions
Expand Down Expand Up @@ -144,7 +144,7 @@ jobs:
contents: read
steps:
- name: Checkout actions folder
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
sparse-checkout: |
actions
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/go-pattern-detector.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/release.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/stale-repo-identifier.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions .github/workflows/super-linter.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 8 additions & 8 deletions .github/workflows/ubuntu-image-analyzer.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .github/workflows/unbloat-docs.lock.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

25 changes: 25 additions & 0 deletions pkg/workflow/data/action_pins.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
"version": "v5.0.2",
"sha": "8b402f58fbc84540c8b491a91e594a4576fec3d7"
},
"actions/checkout@v5": {
"repo": "actions/checkout",
"version": "v5",
"sha": "93cb6efe18208431cddfb8368fd83d5badbf9bfd"
},
"actions/checkout@v6.0.2": {
"repo": "actions/checkout",
"version": "v6.0.2",
Expand All @@ -35,11 +40,21 @@
"version": "v3.0.0-beta.2",
"sha": "bf559f85448f9380bcfa2899dbdc01eb5b37be3a"
},
"actions/download-artifact@v6": {
"repo": "actions/download-artifact",
"version": "v6",
"sha": "018cc2cf5baa6db3ef3c5f8a56943fffe632ef53"
},
"actions/download-artifact@v7": {
"repo": "actions/download-artifact",
"version": "v7",
"sha": "37930b1c2abaa49bbe596cd826c3c89aef350131"
},
"actions/github-script@v7": {
"repo": "actions/github-script",
"version": "v7",
"sha": "f28e40c7f34bde8b3046d885e986cb6290c5673b"
},
"actions/github-script@v8": {
"repo": "actions/github-script",
"version": "v8",
Expand Down Expand Up @@ -125,6 +140,11 @@
"version": "v4.32.0",
"sha": "e6985fd516cce3b1a0e8db34a4013d2e50a1e252"
},
"github/stale-repos@v3": {
"repo": "github/stale-repos",
"version": "v3",
"sha": "3477b6488008d9411aaf22a0924ec7c1f6a69980"
},
"github/stale-repos@v8.0.4": {
"repo": "github/stale-repos",
"version": "v8.0.4",
Expand All @@ -145,6 +165,11 @@
"version": "v1.286.0",
"sha": "90be1154f987f4dc0fe0dd0feedac9e473aa4ba8"
},
"super-linter/super-linter@v8.2.1": {
"repo": "super-linter/super-linter",
"version": "v8.2.1",
"sha": "2bdd90ed3262e023ac84bf8fe35dc480721fc1f2"
},
"super-linter/super-linter@v8.3.2": {
"repo": "super-linter/super-linter",
"version": "v8.3.2",
Expand Down
42 changes: 30 additions & 12 deletions pkg/workflow/mcp_renderer.go
Original file line number Diff line number Diff line change
Expand Up @@ -889,24 +889,42 @@ func prepareConfigForValidation(config string) string {
cleaned := strings.Join(cleanedLines, "\n")

// Substitute shell variables with sample values for validation
// $MCP_GATEWAY_PORT -> 8080 (example port)
// ${MCP_GATEWAY_DOMAIN} -> "localhost" (example domain)
// ${MCP_GATEWAY_API_KEY} -> "sample-api-key" (example key)
// $GITHUB_MCP_SERVER_TOKEN -> "sample-token" (example token)
// $GITHUB_MCP_LOCKDOWN -> "1" (example lockdown value)
// \${...} (escaped for Copilot) -> ${...} (unescaped for validation)

// This makes the config valid JSON that can be validated against the schema
// These variables are normally interpolated by the shell or GitHub Actions at runtime

// 1. Handle backslash-escaped shell variables (used in Copilot engine for JSON strings)
// Pattern: "\${VARIABLE_NAME}" -> "sample-value"
// These are escaped with backslash to prevent shell expansion in the heredoc
cleaned = strings.ReplaceAll(cleaned, "\"\\${GITHUB_TOKEN}\"", "\"sample-token\"")
cleaned = strings.ReplaceAll(cleaned, "\"\\${GITHUB_PERSONAL_ACCESS_TOKEN}\"", "\"sample-token\"")
cleaned = strings.ReplaceAll(cleaned, "\"\\${GITHUB_MCP_SERVER_TOKEN}\"", "\"sample-token\"")
cleaned = strings.ReplaceAll(cleaned, "\"\\${GH_AW_SAFE_INPUTS_API_KEY}\"", "\"sample-api-key\"")
cleaned = strings.ReplaceAll(cleaned, "\"\\${GH_AW_SAFE_OUTPUTS_API_KEY}\"", "\"sample-api-key\"")

// 2. Handle GitHub Actions expressions
// Pattern: ${{ github.workspace }} -> /workspace
// These are interpolated by GitHub Actions before the workflow runs
cleaned = strings.ReplaceAll(cleaned, "${{ github.workspace }}", "/workspace")

// 3. Handle unescaped shell variables in gateway section
// Pattern: $VARIABLE_NAME -> value (unquoted, for numeric values)
// Pattern: "${VARIABLE_NAME}" -> "value" (quoted strings)
cleaned = strings.ReplaceAll(cleaned, "$MCP_GATEWAY_PORT", "8080")
cleaned = strings.ReplaceAll(cleaned, "\"${MCP_GATEWAY_DOMAIN}\"", "\"localhost\"")
cleaned = strings.ReplaceAll(cleaned, "\"${MCP_GATEWAY_API_KEY}\"", "\"sample-api-key\"")

// 4. Handle unescaped shell variables in URLs (for safe-inputs/safe-outputs)
// Pattern: $VARIABLE_NAME in URL -> value
cleaned = strings.ReplaceAll(cleaned, "$GH_AW_SAFE_INPUTS_PORT", "8081")
cleaned = strings.ReplaceAll(cleaned, "$GH_AW_SAFE_OUTPUTS_PORT", "8082")

// 5. Handle other unescaped shell variables
// Pattern: "$VARIABLE_NAME" -> "value" (quoted strings)
cleaned = strings.ReplaceAll(cleaned, "\"$GITHUB_MCP_SERVER_TOKEN\"", "\"sample-token\"")
cleaned = strings.ReplaceAll(cleaned, "\"$GITHUB_MCP_LOCKDOWN\"", "\"1\"")

// Handle Copilot-style escaped variables: \${VARIABLE} -> sample-value
cleaned = strings.ReplaceAll(cleaned, "\\${GITHUB_PERSONAL_ACCESS_TOKEN}", "sample-token")
cleaned = strings.ReplaceAll(cleaned, "\\${GITHUB_MCP_SERVER_TOKEN}", "sample-token")

// Handle shell command substitutions: $([ "$VAR" = "1" ] && echo true || echo false) -> true
// 6. Handle shell command substitutions
// Pattern: "$(command)" -> "result"
cleaned = strings.ReplaceAll(cleaned, "\"$([ \\\"$GITHUB_MCP_LOCKDOWN\\\" = \\\"1\\\" ] && echo true || echo false)\"", "\"true\"")

return cleaned
Expand Down