From 036842e9ec77732c12ab442798f221cb0a7928c2 Mon Sep 17 00:00:00 2001 From: aalu1418 <50029043+aalu1418@users.noreply.github.com> Date: Fri, 9 Feb 2024 09:03:13 -0700 Subject: [PATCH] PR deduplication --- .github/workflows/dependency-updates.yml | 24 +++++++++++++++++++----- 1 file changed, 19 insertions(+), 5 deletions(-) diff --git a/.github/workflows/dependency-updates.yml b/.github/workflows/dependency-updates.yml index 86054aa7a..af095148a 100644 --- a/.github/workflows/dependency-updates.yml +++ b/.github/workflows/dependency-updates.yml @@ -3,24 +3,38 @@ on: workflow_dispatch: schedule: - cron: '0 0 * * *' # check every day at midnight UTC + push: jobs: E2E-Solana-Image: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 # checkout branch that it is called from - - name: check for solana image updates + - name: Check for solana image updates id: solImage run: | make upgrade-e2e-solana-image - image=$(curl https://api.github.com/repos/solana-labs/solana/releases/latest | jq -r '.name') + image=$(curl https://api.github.com/repos/solana-labs/solana/releases/latest | jq -r '.tag_name') echo "image=$image" >> "$GITHUB_OUTPUT" + - name: Check if PR exists + id: check + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + prs=$(gh pr list \ + --repo "$GITHUB_REPOSITORY" \ + --head "bump/solana-${{ steps.solImage.outputs.image }}" \ + --json title \ + --jq 'length') + if ((prs > 0)); then + echo "skip=true" >> "$GITHUB_OUTPUT" + fi - name: Create pull request + if: '!steps.check.outputs.skip' uses: peter-evans/create-pull-request@b1ddad2c994a25fbc81a28b3ec0e368bb2021c50 # v6.0.0 with: - title: "[automated] bump solana dependencies" - branch: bump/dependencies - branch-suffix: timestamp + title: "[automated] bump solana image to ${{ steps.solImage.outputs.image }}" + branch: bump/solana-${{ steps.solImage.outputs.image }} author: "github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>" reviewers: aalu1418 commit-message: "[automated] bump solana dependencies"