Skip to content

Commit 77b0bb3

Browse files
mariuzCopilot
andauthored
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: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: mariuz <18359+mariuz@users.noreply.github.com>
1 parent ee7e6b9 commit 77b0bb3

2 files changed

Lines changed: 31 additions & 0 deletions

File tree

README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,29 @@ echo 'SELECT * FROM rdb$database;' | \
8585
> E.g.: `/tmp/firebird:/var/lib/firebird/data`.<br/>
8686
> This allows accessing database files directly from the host filesystem.
8787

88+
> [!WARNING]
89+
> **Do not mount a path inside `${{ github.workspace }}` as a volume.**
90+
> When `actions/checkout` runs after this action (the default order in most workflows), it deletes and recreates the
91+
> workspace directory (`clean: true` is the default). This removes the host-side mount point, causing the Firebird
92+
> container to lose its data directory and breaking any tests that rely on mapped database files.
93+
>
94+
> Use `${{ runner.temp }}` instead – it persists for the entire job without being touched by checkout:
95+
>
96+
> ```yaml
97+
> volumes: '${{ runner.temp }}/firebird-data:/var/lib/firebird/data'
98+
> ```
99+
>
100+
> If you need tests to access the database files from the runner, pass the same directory to your test command:
101+
>
102+
> ```yaml
103+
> - uses: juarezr/firebirdsql-github-action@v2
104+
> with:
105+
> volumes: '${{ runner.temp }}/firebird-data:/var/lib/firebird/data'
106+
> - uses: actions/checkout@v4
107+
> - name: Run tests
108+
> run: ./gradlew test -Ptest.db.mapped=${{ runner.temp }}/firebird-data
109+
> ```
110+
88111
### Deprecated v1 parameters
89112

90113
`enable_legacy_client_auth`

entrypoint.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -71,6 +71,14 @@ if [ -n "${INPUT_VOLUMES:-}" ]; then
7171
vol=$(printf '%s' "${vol}" | tr -d '\r')
7272
if [ -n "${vol}" ]; then
7373
printf '# Mounting volume: %s\n' "${vol}"
74+
host_path="${vol%%:*}"
75+
if [ -n "${GITHUB_WORKSPACE:-}" ] && \
76+
case "${host_path}" in "${GITHUB_WORKSPACE}/"*) true ;; *) false ;; esac; then
77+
echo "## WARNING: Volume host path '${host_path}' is inside \$GITHUB_WORKSPACE."
78+
echo "## WARNING: If actions/checkout runs after this step (default), it will delete"
79+
echo "## WARNING: the workspace directory (clean: true), breaking the volume mount."
80+
echo "## WARNING: Use \${{ runner.temp }} instead to avoid this problem."
81+
fi
7482
volumes_arg="${volumes_arg} --volume ${vol}"
7583
fi
7684
done

0 commit comments

Comments
 (0)