diff --git a/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml b/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml index 72540d9..c52c612 100644 --- a/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml +++ b/.github/workflows/automerge-dependabot-prs-into-collected-branch.yml @@ -23,6 +23,8 @@ jobs: run: | echo "actor: ${{ github.actor }}" echo "pr title: ${{ github.event.pull_request.title }}" + echo "github event_name: ${{ github.event_name }}" + 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 }}" @@ -35,7 +37,8 @@ jobs: auto-merge: runs-on: ubuntu-latest # if dependabot and checks ran - if: (github.actor == 'dependabot[bot]' || github.event_name == 'workflow_dispatch')&& (github.event_name != 'check_suite' || github.event.check_suite.conclusion == 'success') + # 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: extract update type id: extract diff --git a/.github/workflows/collected-dependabot-staging-to-master.yml b/.github/workflows/collected-dependabot-staging-to-master.yml deleted file mode 100644 index ffcb013..0000000 --- a/.github/workflows/collected-dependabot-staging-to-master.yml +++ /dev/null @@ -1,52 +0,0 @@ -name: Collected Dependabot Promotion From Staging To Master -on: - workflow_dispatch: -# # qqqq in development -# name: Collected Dependabot Promotion From Staging To Master -# on: - # schedule: - # # we want the opposite weeks to staging so we get a week where it occurs in manual testing - # - cron: '0 9 8-14 * 1' # Second Monday of month - # - cron: '0 9 22-28 * 1' # Fourth Monday of month - # workflow_dispatch: - -# jobs: - # promote-to-master: - # runs-on: ubuntu-latest - # permissions: - # contents: write - # pull-requests: write - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - - # - name: Check for changes - # id: changes - # run: | - # git fetch origin Automatic_collected_dependabot_staging:Automatic_collected_dependabot_staging - # git fetch origin master:master - - # if git diff --quiet master Automatic_collected_dependabot_staging; then - # echo "has_changes=false" >> $GITHUB_OUTPUT - # else - # echo "has_changes=true" >> $GITHUB_OUTPUT - # fi - - # - name: Create PR to master - # if: steps.changes.outputs.has_changes == 'true' - # run: | - # if gh pr list --head Automatic_collected_dependabot_staging --base master --json number --jq '.[0].number' | grep -q .; then - # echo "PR already exists, skipping creation" - # else - # gh pr create \ - # --base master \ - # --head Automatic_collected_dependabot_staging \ - # --title "Fortnightly dependabot collected master promotion - $(date +%Y-%m-%d)" \ - # --body "Automated weekly promotion from staging to master after testing period" \ - # --auto-merge \ - # --merge - # fi - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/collected-dependabot-staging-to-master.yml-disabled b/.github/workflows/collected-dependabot-staging-to-master.yml-disabled new file mode 100644 index 0000000..5a1332e --- /dev/null +++ b/.github/workflows/collected-dependabot-staging-to-master.yml-disabled @@ -0,0 +1,49 @@ +# qqqq in development +name: Collected Dependabot Promotion From Staging To Master +on: + schedule: + # we want the opposite weeks to staging so we get a week where it occurs in manual testing + - cron: '0 9 8-14 * 1' # Second Monday of month + - cron: '0 9 22-28 * 1' # Fourth Monday of month + workflow_dispatch: + +jobs: + promote-to-master: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check for changes + id: changes + run: | + git fetch origin Automatic_collected_dependabot_staging:Automatic_collected_dependabot_staging + git fetch origin master:master + + if git diff --quiet master Automatic_collected_dependabot_staging; then + echo "has_changes=false" >> $GITHUB_OUTPUT + else + echo "has_changes=true" >> $GITHUB_OUTPUT + fi + + - name: Create PR to master + if: steps.changes.outputs.has_changes == 'true' + run: | + if gh pr list --head Automatic_collected_dependabot_staging --base master --json number --jq '.[0].number' | grep -q .; then + echo "PR already exists, skipping creation" + else + gh pr create \ + --base master \ + --head Automatic_collected_dependabot_staging \ + --title "Fortnightly dependabot collected master promotion - $(date +%Y-%m-%d)" \ + --body "Automated weekly promotion from staging to master after testing period" \ + --auto-merge \ + --merge + fi + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/collected-dependabot-to-staging.yml b/.github/workflows/collected-dependabot-to-staging.yml deleted file mode 100644 index 817768d..0000000 --- a/.github/workflows/collected-dependabot-to-staging.yml +++ /dev/null @@ -1,49 +0,0 @@ -# # qqqq in development -name: Dependabot Collected Promotion To Staging -on: - workflow_dispatch: -# name: Dependabot Collected Promotion To Staging -# # this logic will require branch ruleset checks of running the dev pipeline -# on: - # schedule: - # # Promotion from staging to release should be a week apart so alternating weeks (also live updates dangerous) - # - cron: '0 9 1-7 * 1' # First Monday of month - # - cron: '0 9 15-21 * 1' # Third Monday of month - # workflow_dispatch: # Allow manual trigger - -# jobs: - # promote-to-automatic-collected-dependabot-staging: - # runs-on: ubuntu-latest - # permissions: - # contents: write - # pull-requests: write - # steps: - # - name: Checkout - # uses: actions/checkout@v4 - # with: - # fetch-depth: 0 - - # - name: Check for changes - # id: changes - # run: | - # git fetch origin Automatic_version_update_dependabot:Automatic_version_update_dependabot - # git fetch origin Automatic_collected_dependabot_staging:Automatic_collected_dependabot_staging - - # if git diff --quiet Automatic_collected_dependabot_staging Automatic_version_update_dependabot; then - # echo "has_changes=false" >> $GITHUB_OUTPUT - # else - # echo "has_changes=true" >> $GITHUB_OUTPUT - # fi - - # - name: Create PR to Automatic_collected_dependabot_staging - # if: steps.changes.outputs.has_changes == 'true' - # run: | - # gh pr create \ - # --base Automatic_collected_dependabot_staging \ - # --head Automatic_version_update_dependabot \ - # --title "Fortnightly dependabot collected to staging - $(date +%Y-%m-%d)" \ - # --body "Automated Fortnightly promotion of dependency updates from dependabot" \ - # --auto-merge \ - # --merge - # env: - # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file diff --git a/.github/workflows/collected-dependabot-to-staging.yml-disabled b/.github/workflows/collected-dependabot-to-staging.yml-disabled new file mode 100644 index 0000000..b3dba35 --- /dev/null +++ b/.github/workflows/collected-dependabot-to-staging.yml-disabled @@ -0,0 +1,47 @@ +# qqqq in development + +name: Dependabot Collected Promotion To Staging +# this logic will require branch ruleset checks of running the dev pipeline +on: + schedule: + # Promotion from staging to release should be a week apart so alternating weeks (also live updates dangerous) + - cron: '0 9 1-7 * 1' # First Monday of month + - cron: '0 9 15-21 * 1' # Third Monday of month + workflow_dispatch: # Allow manual trigger + +jobs: + promote-to-automatic-collected-dependabot-staging: + runs-on: ubuntu-latest + permissions: + contents: write + pull-requests: write + steps: + - name: Checkout + uses: actions/checkout@v4 + with: + fetch-depth: 0 + + - name: Check for changes + id: changes + run: | + git fetch origin Automatic_version_update_dependabot:Automatic_version_update_dependabot + git fetch origin Automatic_collected_dependabot_staging:Automatic_collected_dependabot_staging + + if git diff --quiet Automatic_collected_dependabot_staging Automatic_version_update_dependabot; then + echo "has_changes=false" >> $GITHUB_OUTPUT + else + echo "has_changes=true" >> $GITHUB_OUTPUT + fi + + - name: Create PR to Automatic_collected_dependabot_staging + if: steps.changes.outputs.has_changes == 'true' + run: | + gh pr create \ + --base Automatic_collected_dependabot_staging \ + --head Automatic_version_update_dependabot \ + --title "Fortnightly dependabot collected to staging - $(date +%Y-%m-%d)" \ + --body "Automated Fortnightly promotion of dependency updates from dependabot" \ + --auto-merge \ + --merge + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file