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
30 changes: 16 additions & 14 deletions actions/setup/src/index.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// Setup Activation Action
// Copies activation job files to the agent environment

const core = require('@actions/core');
const fs = require('fs');
const path = require('path');
const core = require("@actions/core");
const fs = require("fs");
const path = require("path");

// Embedded activation files will be inserted here during build
const FILES = {
Expand All @@ -12,29 +12,31 @@ const FILES = {

async function run() {
try {
const destination = core.getInput('destination') || '/tmp/gh-aw/actions/activation';
const destination = core.getInput("destination") || "/tmp/gh-aw/actions/activation";

core.info(`Copying activation files to ${destination}`);

// Create destination directory if it doesn't exist

// Create destination directory with secure permissions if it doesn't exist
// Note: mode parameter is ignored on Windows; relies on default NTFS permissions
if (!fs.existsSync(destination)) {
fs.mkdirSync(destination, { recursive: true });
fs.mkdirSync(destination, { recursive: true, mode: 0o700 });
core.info(`Created directory: ${destination}`);
}

let fileCount = 0;

// Copy each embedded file
for (const [filename, content] of Object.entries(FILES)) {
const filePath = path.join(destination, filename);
fs.writeFileSync(filePath, content, 'utf8');
// Create file with secure permissions (readable/writable only by owner)
// Note: mode parameter is ignored on Windows; relies on default NTFS permissions
fs.writeFileSync(filePath, content, { encoding: "utf8", mode: 0o600 });
core.info(`Copied: ${filename}`);
fileCount++;
}
core.setOutput('files-copied', fileCount.toString());

core.setOutput("files-copied", fileCount.toString());
core.info(`✓ Successfully copied ${fileCount} files`);

} catch (error) {
core.setFailed(`Action failed: ${error.message}`);
}
Expand Down
2 changes: 1 addition & 1 deletion pkg/workflow/claude_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -229,7 +229,7 @@ func (e *ClaudeEngine) GetExecutionSteps(workflowData *WorkflowData, logFile str
// Use claude command directly (available in PATH from hostedtoolcache mount)
commandName = "claude"
}

commandParts := []string{commandName}
commandParts = append(commandParts, claudeArgs...)
commandParts = append(commandParts, promptCommand)
Expand Down
4 changes: 2 additions & 2 deletions pkg/workflow/codex_engine.go
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ func (e *CodexEngine) GetExecutionSteps(workflowData *WorkflowData, logFile stri
// PATH will be set to find codex in hostedtoolcache when firewall is enabled
commandName = "codex"
}

codexCommand := fmt.Sprintf("%s %sexec%s%s%s\"$INSTRUCTION\"",
commandName, modelParam, webSearchParam, fullAutoParam, customArgsParam)

Expand Down Expand Up @@ -316,7 +316,7 @@ mkdir -p "$CODEX_HOME/logs"
} else {
commandName = "codex"
}

if workflowData.AgentFile != "" {
agentPath := ResolveAgentFilePath(workflowData.AgentFile)
command = fmt.Sprintf(`set -o pipefail
Expand Down
6 changes: 3 additions & 3 deletions pkg/workflow/copilot_engine_execution.go
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ func (e *CopilotEngine) GetExecutionSteps(workflowData *WorkflowData, logFile st
if sandboxEnabled {
// Build base command
var baseCommand string

// Check if custom command is specified
var commandName string
if workflowData.EngineConfig != nil && workflowData.EngineConfig.Command != "" {
Expand All @@ -171,7 +171,7 @@ func (e *CopilotEngine) GetExecutionSteps(workflowData *WorkflowData, logFile st
commandName = "/usr/local/bin/copilot"
}
}

baseCommand = fmt.Sprintf("%s %s", commandName, shellJoinArgs(copilotArgs))

// Add conditional model flag if needed
Expand All @@ -189,7 +189,7 @@ func (e *CopilotEngine) GetExecutionSteps(workflowData *WorkflowData, logFile st
} else {
commandName = "copilot"
}

baseCommand := fmt.Sprintf("%s %s", commandName, shellJoinArgs(copilotArgs))

// Add conditional model flag if needed
Expand Down