diff --git a/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml b/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml index c52c612..74c4e86 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,19 +29,29 @@ 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 }}" - - - 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 + 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 }}" + 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') + 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 + + - 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: |