From 8b9fc9d3596fc5b58201f422e703e4fb48ed87bc Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Tue, 21 Apr 2026 10:18:49 +0000 Subject: [PATCH] docs+runtime: warn when volumes mount under $GITHUB_WORKSPACE Agent-Logs-Url: https://github.com/mariuz/firebirdsql-github-action/sessions/5e8a36d9-221b-4c97-8b33-20f4fd4e2495 Co-authored-by: mariuz <18359+mariuz@users.noreply.github.com> --- README.md | 23 +++++++++++++++++++++++ entrypoint.sh | 8 ++++++++ 2 files changed, 31 insertions(+) diff --git a/README.md b/README.md index 607c11f..ae77eef 100644 --- a/README.md +++ b/README.md @@ -85,6 +85,29 @@ echo 'SELECT * FROM rdb$database;' | \ > E.g.: `/tmp/firebird:/var/lib/firebird/data`.
> This allows accessing database files directly from the host filesystem. +> [!WARNING] +> **Do not mount a path inside `${{ github.workspace }}` as a volume.** +> When `actions/checkout` runs after this action (the default order in most workflows), it deletes and recreates the +> workspace directory (`clean: true` is the default). This removes the host-side mount point, causing the Firebird +> container to lose its data directory and breaking any tests that rely on mapped database files. +> +> Use `${{ runner.temp }}` instead – it persists for the entire job without being touched by checkout: +> +> ```yaml +> volumes: '${{ runner.temp }}/firebird-data:/var/lib/firebird/data' +> ``` +> +> If you need tests to access the database files from the runner, pass the same directory to your test command: +> +> ```yaml +> - uses: juarezr/firebirdsql-github-action@v2 +> with: +> volumes: '${{ runner.temp }}/firebird-data:/var/lib/firebird/data' +> - uses: actions/checkout@v4 +> - name: Run tests +> run: ./gradlew test -Ptest.db.mapped=${{ runner.temp }}/firebird-data +> ``` + ### Deprecated v1 parameters `enable_legacy_client_auth` diff --git a/entrypoint.sh b/entrypoint.sh index 3931e52..ad31866 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -71,6 +71,14 @@ if [ -n "${INPUT_VOLUMES:-}" ]; then vol=$(printf '%s' "${vol}" | tr -d '\r') if [ -n "${vol}" ]; then printf '# Mounting volume: %s\n' "${vol}" + host_path="${vol%%:*}" + if [ -n "${GITHUB_WORKSPACE:-}" ] && \ + case "${host_path}" in "${GITHUB_WORKSPACE}/"*) true ;; *) false ;; esac; then + echo "## WARNING: Volume host path '${host_path}' is inside \$GITHUB_WORKSPACE." + echo "## WARNING: If actions/checkout runs after this step (default), it will delete" + echo "## WARNING: the workspace directory (clean: true), breaking the volume mount." + echo "## WARNING: Use \${{ runner.temp }} instead to avoid this problem." + fi volumes_arg="${volumes_arg} --volume ${vol}" fi done