From e962141c131aa4a0502a19ae65e7158c6f7d7494 Mon Sep 17 00:00:00 2001 From: Phil-NHS Date: Mon, 1 Sep 2025 13:49:41 +0100 Subject: [PATCH 1/2] chore(dependabot): autom --- ...e-dependabot-prs-into-collected-branch.yml | 22 ++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml b/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml index c52c612..dc03fe3 100644 --- a/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml +++ b/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml @@ -1,15 +1,17 @@ # qqqq in development +# qqqq not getting the events # this script seperate major and minor but we do merge them into the same branch. # having two steps allows us to easily turn off major changes in future and then script them to their own branch and pipeline. name: auto-merge dependabot prs into collected branch on: - pull_request: + # pull_request: # synchronize - types: [opened, synchronize] - branches: [automatic_version_update_dependabot] # make sure this matches your actual branch name + # types: [opened, synchronize] + # branches: [automatic_version_update_dependabot] # make sure this matches your actual branch name check_suite: types: [completed] workflow_dispatch: + permissions: contents: write pull-requests: write @@ -27,6 +29,10 @@ jobs: echo "github event_suite conlusion: ${{ github.event.check_suite.conclusion }}" echo "target branch: ${{ github.event.pull_request.base.ref }}" echo "source branch: ${{ github.event.pull_request.head.ref }}" + echo "Check Suite ID: ${{ github.event.check_suite.id }}" + echo "Conclusion: ${{ github.event.check_suite.conclusion }}" + echo "Target Branch: ${{ github.event.check_suite.pull_requests[0].base.ref }}" + echo "PR Number: ${{ github.event.check_suite.pull_requests[0].number }}" - name: delay for check run: | @@ -36,10 +42,20 @@ jobs: auto-merge: runs-on: ubuntu-latest + # if: github.event.check_suite.pull_requests[0].base.ref == 'main' # if dependabot and checks ran # if: (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success') # qqqq put back in later if: (github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch')&& (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success') steps: + - name: Checkout the repository + uses: actions/checkout@v3 + + - name: Set up GitHub CLI + run: | + # Install GitHub CLI (gh) + sudo apt-get update + sudo apt-get install gh + - name: extract update type id: extract run: | From d744e96a1861e6dd018be26dc151212c84b6cc1c Mon Sep 17 00:00:00 2001 From: Phil-NHS Date: Mon, 1 Sep 2025 14:21:21 +0100 Subject: [PATCH 2/2] chore(dependabot): naming caps --- .../automerge-dependabot-prs-into-collected-branch.yml | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml b/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml index dc03fe3..74c4e86 100644 --- a/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml +++ b/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml @@ -7,7 +7,7 @@ on: # pull_request: # synchronize # types: [opened, synchronize] - # branches: [automatic_version_update_dependabot] # make sure this matches your actual branch name + # branches: [Automatic_version_update_dependabot] # make sure this matches your actual branch name check_suite: types: [completed] workflow_dispatch: @@ -33,12 +33,7 @@ jobs: echo "Conclusion: ${{ github.event.check_suite.conclusion }}" echo "Target Branch: ${{ github.event.check_suite.pull_requests[0].base.ref }}" echo "PR Number: ${{ github.event.check_suite.pull_requests[0].number }}" - - - name: delay for check - run: | - # drop later qqqq shouldnt need but its running before auto - echo "waiting 4 minutes for other checks to start running..." - sleep 240 + auto-merge: runs-on: ubuntu-latest @@ -46,6 +41,7 @@ jobs: # if dependabot and checks ran # if: (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success') # qqqq put back in later if: (github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch')&& (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success') + if: github.event.check_suite.conclusion == 'success' && github.actor == 'dependabot[bot]' && github.event.check_suite.pull_requests[0].base.ref == 'Automatic_version_update_dependabot' steps: - name: Checkout the repository uses: actions/checkout@v3