mirror of
https://github.com/bahdotsh/wrkflw.git
synced 2025-12-16 19:57:44 +01:00
fix(docker): mount GitHub environment files directory into containers
- Mount GitHub environment files directory containing GITHUB_ENV, GITHUB_OUTPUT, GITHUB_PATH, and GITHUB_STEP_SUMMARY - Resolves Docker container exit code -1 when writing to $GITHUB_ENV - Update volume mapping in both step execution contexts in engine.rs - Tested on macOS with Docker Desktop Closes: Issue where echo "VAR=value" >> "$GITHUB_ENV" fails in Docker runtime
This commit is contained in:
@@ -1,12 +0,0 @@
|
||||
name: Clippy Test
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
test:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Test secrets after clippy fixes
|
||||
env:
|
||||
TEST_VAR: ${{ secrets.TEST_SECRET }}
|
||||
run: |
|
||||
echo "Secret length: ${#TEST_VAR}"
|
||||
@@ -1538,7 +1538,16 @@ async fn execute_step(ctx: StepExecutionContext<'_>) -> Result<StepResult, Execu
|
||||
let container_workspace = Path::new("/github/workspace");
|
||||
|
||||
// Set up volume mapping from host working dir to container workspace
|
||||
let volumes: Vec<(&Path, &Path)> = vec![(ctx.working_dir, container_workspace)];
|
||||
let mut volumes: Vec<(&Path, &Path)> = vec![(ctx.working_dir, container_workspace)];
|
||||
|
||||
// Also mount the GitHub environment files directory if GITHUB_ENV is set
|
||||
if let Some(github_env_path) = ctx.job_env.get("GITHUB_ENV") {
|
||||
if let Some(github_dir) = Path::new(github_env_path).parent() {
|
||||
if let Some(github_parent) = github_dir.parent() {
|
||||
volumes.push((github_parent, github_parent));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
let output = ctx
|
||||
.runtime
|
||||
@@ -1687,7 +1696,16 @@ async fn execute_step(ctx: StepExecutionContext<'_>) -> Result<StepResult, Execu
|
||||
let container_workspace = Path::new("/github/workspace");
|
||||
|
||||
// Set up volume mapping from host working dir to container workspace
|
||||
let volumes: Vec<(&Path, &Path)> = vec![(ctx.working_dir, container_workspace)];
|
||||
let mut volumes: Vec<(&Path, &Path)> = vec![(ctx.working_dir, container_workspace)];
|
||||
|
||||
// Also mount the GitHub environment files directory if GITHUB_ENV is set
|
||||
if let Some(github_env_path) = ctx.job_env.get("GITHUB_ENV") {
|
||||
if let Some(github_dir) = Path::new(github_env_path).parent() {
|
||||
if let Some(github_parent) = github_dir.parent() {
|
||||
volumes.push((github_parent, github_parent));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Execute the command
|
||||
match ctx
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
name: Final Secrets Test
|
||||
on: [push]
|
||||
|
||||
jobs:
|
||||
verify-secrets:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Test secrets are working
|
||||
env:
|
||||
SECRET_VAL: ${{ secrets.TEST_SECRET }}
|
||||
run: |
|
||||
echo "Secret length: ${#SECRET_VAL}"
|
||||
echo "All secrets functionality verified!"
|
||||
Reference in New Issue
Block a user