Skip to content

Commit

Permalink
ci: Run GH action CI build+test as non-root
Browse files Browse the repository at this point in the history
This is really the standard best practice, matching how
e.g. dpkg/rpm work, as well as most local development
environments (including mine) with e.g. `toolbox`.
  • Loading branch information
cgwalters committed Aug 26, 2021
1 parent 30909a2 commit ea2ec16
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -120,8 +120,11 @@ jobs:
- name: Install dependencies
run: ./ci/gh-install.sh ${{ matrix.extra-packages }}

- name: Add non-root user
run: "useradd builder && chown -R -h builder: ."

- name: Build and test
run: ./ci/gh-build.sh ${{ matrix.configure-options }}
run: runuser -u builder -- ./ci/gh-build.sh ${{ matrix.configure-options }}
env:
# GitHub hosted runners currently have 2 CPUs, so run 2
# parallel make jobs.
Expand Down

0 comments on commit ea2ec16

Please sign in to comment.