From d93028e2c2e48daee0c9e6f9d14a1d4a5f5e18aa Mon Sep 17 00:00:00 2001 From: slobentanzer Date: Fri, 21 Feb 2025 01:08:46 +0100 Subject: [PATCH] try automerging PR --- .github/workflows/benchmark-processing.yml | 30 +++++++++++++++++----- 1 file changed, 23 insertions(+), 7 deletions(-) diff --git a/.github/workflows/benchmark-processing.yml b/.github/workflows/benchmark-processing.yml index aec31fad..d37d2535 100644 --- a/.github/workflows/benchmark-processing.yml +++ b/.github/workflows/benchmark-processing.yml @@ -14,6 +14,9 @@ on: jobs: process-results: runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write steps: - uses: actions/checkout@v4 @@ -32,11 +35,24 @@ jobs: run: | python docs/scripts/hooks.py - - name: Commit and push if changes - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + - name: Create Pull Request + uses: peter-evans/create-pull-request@v6 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: Update benchmark visualizations + title: 'chore: update benchmark visualizations' + body: | + Automated PR to update benchmark visualizations + + This PR was automatically created by the benchmark processing workflow. + branch: update-benchmark-visualizations + base: main + delete-branch: true + + - name: Enable Pull Request Automerge + if: steps.create-pull-request.outputs.pull-request-operation == 'created' run: | - git config --local user.email "github-actions[bot]@users.noreply.github.com" - git config --local user.name "github-actions[bot]" - git add docs/ - git diff --quiet && git diff --staged --quiet || (git commit -m "Update benchmark visualizations" && git push "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git" HEAD:main) \ No newline at end of file + PR_NUMBER=$(jq --raw-output .pull_request.number "$GITHUB_EVENT_PATH") + gh pr merge --auto --merge "$PR_NUMBER" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file