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
23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,29 @@ echo 'SELECT * FROM rdb$database;' | \
> E.g.: `/tmp/firebird:/var/lib/firebird/data`.<br/>
> 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`
Expand Down
8 changes: 8 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Loading