fix: allow running as root to inject chaos #885
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Go CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
paths: | |
- go-chaos/** | |
env: | |
GO_VERSION: 1.19 | |
jobs: | |
go-ci: | |
name: Run Go CI | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: go-chaos | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Set up Go | |
uses: actions/setup-go@v2 | |
with: | |
go-version: "${{ env.GO_VERSION }}" | |
- name: Go Format check | |
run: | | |
make fmt | |
diff=$(git status --porcelain) | |
if [ -n "$diff" ] | |
then | |
echo "Some files are not following the go format ($diff), run gofmt and fix your files." | |
exit 1 | |
fi | |
- name: Install License Tool | |
run: make installLicense | |
- name: Check License | |
run: make checkLicense | |
- name: Run Go Tests | |
run: make test | |
auto-merge: | |
name: Auto-merge dependabot PRs | |
runs-on: ubuntu-latest | |
needs: [ go-ci ] | |
if: github.repository == 'zeebe-io/zeebe-chaos' && github.actor == 'dependabot[bot]' | |
permissions: | |
checks: read | |
pull-requests: write | |
steps: | |
- uses: actions/checkout@v3 | |
- id: metadata | |
name: Fetch dependency metadata | |
uses: dependabot/fetch-metadata@v1.3.6 | |
with: | |
github-token: "${{ secrets.AUTO_MERGE_GITHUB_TOKEN }}" | |
- id: merge | |
name: Merge PR | |
run: gh pr merge ${{ github.event.pull_request.number }} --merge | |
env: | |
GITHUB_TOKEN: "${{ secrets.AUTO_MERGE_GITHUB_TOKEN }}" |