Merge pull request #2424 from cgwalters/test-nonroot-ci

ci: Run GH action CI build+test as non-root
This commit is contained in:
Colin Walters 2021-08-26 17:25:59 -04:00 committed by GitHub
commit 77a86ccba3
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -120,8 +120,11 @@ jobs:
- name: Install dependencies - name: Install dependencies
run: ./ci/gh-install.sh ${{ matrix.extra-packages }} run: ./ci/gh-install.sh ${{ matrix.extra-packages }}
- name: Add non-root user
run: "useradd builder && chown -R -h builder: ."
- name: Build and test - name: Build and test
run: ./ci/gh-build.sh ${{ matrix.configure-options }} run: runuser -u builder -- ./ci/gh-build.sh ${{ matrix.configure-options }}
env: env:
# GitHub hosted runners currently have 2 CPUs, so run 2 # GitHub hosted runners currently have 2 CPUs, so run 2
# parallel make jobs. # parallel make jobs.