Skip to content

Commit 17b6dcc

Browse files
committed
test user override with env variable
1 parent c771218 commit 17b6dcc

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

.github/workflows/nextflow-test-container.yml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,17 +28,21 @@ jobs:
2828
key: docker-cache-${{ runner.os }}-${{ hashFiles('**/nextflow.config', '**/modules.config') }}
2929
restore-keys: |
3030
docker-cache-${{ runner.os }}-
31-
31+
32+
- name: Capture runner UID/GID
33+
run: |
34+
echo "UID=$(id -u)" >> $GITHUB_ENV
35+
echo "GID=$(id -g)" >> $GITHUB_ENV
36+
3237
- name: Install Nextflow
3338
run: |
3439
curl -s https://get.nextflow.io | bash
3540
sudo mv nextflow /usr/local/bin/
3641
nextflow -version
3742
38-
- name: Ensure workspace writable
39-
run: sudo chmod -R a+rwx "$GITHUB_WORKSPACE"
40-
4143
- name: Run Nextflow pipeline with Docker
44+
env:
45+
NXF_DEFAULT_DOCKER_OPTS: "-u ${{ env.UID }}:${{ env.GID }}"
4246
run: |
4347
nextflow run main.nf -profile test -with-docker
4448

0 commit comments

Comments
 (0)