name: Update codegen on: pull_request: branches: [main] permissions: {} jobs: codegen: runs-on: ubuntu-latest permissions: contents: write steps: - uses: actions/checkout@v4 with: ref: ${{ github.head_ref }} token: ${{ secrets.GITHUB_TOKEN }} - uses: actions/setup-go@v5 - run: | sudo apt-get update sudo apt-get install -y clang llvm libbpf-dev linux-headers-generic - run: | sudo bpftool btf dump file /sys/kernel/btf/vmlinux format c > pkg/ebpf/bpf/vmlinux.h go generate ./pkg/ebpf/bpf # Check for changes. Commit and push them. - run: | git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com" if [ -n "$(git status --porcelain)" ]; then git add . git commit -m "Update generated code" git push exit 1 # Workflow should fail, so the PR author reviews the changes else echo "No changes to commit" fi