From 76d1b9f46e40b7ad819c928b53c277331aa682b5 Mon Sep 17 00:00:00 2001 From: Tamir Duberstein Date: Tue, 4 Feb 2025 15:06:22 -0500 Subject: [PATCH] gen: use peter-evans/create-pull-request@v7 We already use this for the lint job on main. --- .github/workflows/ci.yml | 6 ++++- .github/workflows/gen.yml | 48 +++++++++------------------------------ 2 files changed, 16 insertions(+), 38 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dd8942eb..af702576 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,7 +59,11 @@ jobs: - uses: peter-evans/create-pull-request@v7 if: github.event_name != 'pull_request' && github.repository_owner == 'aya-rs' with: - commit-message: "public-api: regenerate" + branch: create-pull-request/public-api + commit-message: 'public-api: regenerate' + title: 'public-api: regenerate' + body: | + **Automated changes** - name: Run miri run: | diff --git a/.github/workflows/gen.yml b/.github/workflows/gen.yml index 35a7afd3..a5dd3eee 100644 --- a/.github/workflows/gen.yml +++ b/.github/workflows/gen.yml @@ -14,61 +14,35 @@ jobs: - name: update libbpf working-directory: xtask/libbpf run: | - set -e + set -euxo pipefail git fetch origin git checkout origin/HEAD echo "LIBBPF_SHA=$(git rev-parse HEAD)" >> $GITHUB_ENV - - uses: dtolnay/rust-toolchain@master + - uses: dtolnay/rust-toolchain@nightly with: - toolchain: nightly components: rustfmt, clippy - uses: Swatinem/rust-cache@v2 - name: Install headers run: | + set -euxo pipefail sudo apt -y update sudo apt -y install libelf-dev libc6-dev libc6-dev-{arm64,armel,riscv64,ppc64el,s390x,mips}-cross - - name: Run codegen - run: | - cargo xtask codegen - - - name: Check for changes - run: | - git diff --quiet || echo "COMMIT_CHANGES=1" >> $GITHUB_ENV - - - name: Bless public API changes - if: env.COMMIT_CHANGES == 1 - run: | - cargo xtask public-api --bless + - run: cargo xtask codegen + - run: cargo xtask public-api --bless - - name: Commit Changes - id: commit - if: env.COMMIT_CHANGES == 1 - uses: devops-infra/action-commit-push@master + - uses: peter-evans/create-pull-request@v7 with: - github_token: "${{ secrets.CRABBY_GITHUB_TOKEN }}" - commit_message: | - chore(aya-obj, aya-ebpf-bindings): Regenerate bindings + branch: create-pull-request/codegen + commit-message: | + aya-obj, aya-ebpf-bindings: regenerate libbpf commit: ${{ env.LIBBPF_SHA }} - - target_branch: codegen - force: true - - - name: Create pull request - if: steps.commit.outputs.files_changed != '' - uses: devops-infra/action-pull-request@master - with: - github_token: ${{ secrets.CRABBY_GITHUB_TOKEN }} + title: 'aya-obj, aya-ebpf-bindings: regenerate' body: | - **Automated pull request** + **Automated changes** libbpf commit: ${{ env.LIBBPF_SHA }} - - title: "chore(aya-obj, aya-ebpf-bindings): Regenerate bindings" - source_branch: codegen - target_branch: main - get_diff: true