File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff 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`
Original file line number Diff line number Diff 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
You can’t perform that action at this time.
0 commit comments