Merge main branch into docker-25 after successful build #207
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Merge main branch into docker-25 after successful build | |
| on: | |
| workflow_run: | |
| workflows: [release] | |
| types: [completed] | |
| branches: [main] | |
| workflow_dispatch: {} | |
| jobs: | |
| merge-main-into-docker-25: | |
| permissions: | |
| contents: write | |
| if: ${{ github.event_name == 'workflow_dispatch' || github.event.workflow_run.conclusion == 'success' }} | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| with: | |
| ref: docker-25 | |
| fetch-depth: 0 # fetch the whole thing to make sure the histories merge | |
| token: ${{ secrets.REPO_TOKEN_FOR_MERGE_AND_PUSH }} | |
| - name: Determine merge commit | |
| id: merge-source | |
| run: | | |
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | |
| echo "sha=$(git rev-parse origin/main)" >> "$GITHUB_OUTPUT" | |
| echo "label=main (latest)" >> "$GITHUB_OUTPUT" | |
| else | |
| echo "sha=${{ github.event.workflow_run.head_sha }}" >> "$GITHUB_OUTPUT" | |
| echo "label=main (${{ github.event.workflow_run.head_sha }})" >> "$GITHUB_OUTPUT" | |
| fi | |
| - name: Merge main into docker-25 | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| echo "Merging ${{ steps.merge-source.outputs.sha }} into docker-25..." | |
| git merge ${{ steps.merge-source.outputs.sha }} \ | |
| -m "Auto-merging ${{ steps.merge-source.outputs.label }} into docker-25 after successful release build" | |
| git push origin docker-25 |