Skip to content

Commit

Permalink
Use non-root user in actions
Browse files Browse the repository at this point in the history
  • Loading branch information
felipecrs committed Aug 25, 2020
1 parent 37d3d40 commit 9df6cf6
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -7,17 +7,31 @@ on:
branches: [master]

jobs:
configure:
runs-on: ubuntu-latest
outputs:
uid_gid: ${{ steps.get-user.outputs.uid_gid }}
steps:
- id: get-user
run: echo "::set-output name=uid_gid::$(id -u):$(id -g)"

clone-and-install:
needs: configure
runs-on: ubuntu-latest
container: mcr.microsoft.com/vscode/devcontainers/base:ubuntu
container:
image: mcr.microsoft.com/vscode/devcontainers/base:ubuntu
options: --user ${{ needs.configure.outputs.uid_gid }}
steps:
- uses: actions/checkout@v2
- run: ./install
- run: '"$HOME/.local/bin/chezmoi" data'

convenience-script:
needs: configure
runs-on: ubuntu-latest
container: mcr.microsoft.com/vscode/devcontainers/base:ubuntu
container:
image: mcr.microsoft.com/vscode/devcontainers/base:ubuntu
options: --user ${{ needs.configure.outputs.uid_gid }}
steps:
- run: sh -c "$(wget -qO- 'https://raw.githubusercontent.com/felipecassiors/dotfiles/${{ github.sha }}/scripts/install_dotfiles.sh')"
- run: '"$HOME/.local/bin/chezmoi" data'

0 comments on commit 9df6cf6

Please sign in to comment.