Skip to content

Commit

Permalink
fix: use workaround actions/runner#691 to run as non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
opicaud committed May 11, 2024
1 parent 9c23aa6 commit 8abd363
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,13 @@ on:
branches:
- main
jobs:
configure:
runs-on: ubuntu-20.04
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"
monorepo-job:
runs-on: ubuntu-20.04
permissions:
Expand All @@ -14,7 +21,7 @@ jobs:
volumes:
- /usr/bin/docker:/usr/bin/docker
- /var/run/docker.sock:/var/run/docker.sock
options: -e USER="root" -u="root"
options: -e USER=${{ needs.configure.outputs.uid_gid }} -u=${{ needs.configure.outputs.uid_gid }}
steps:
- uses: actions/checkout@v4
with:
Expand Down

0 comments on commit 8abd363

Please sign in to comment.