File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -65,16 +65,27 @@ jobs:
6565 sed -i 's#\(blazordevlab/cleanarchitectureblazorserver:\).*#\1${{ steps.version.outputs.version }}#' .github/workflows/deploy/docker-compose.yml
6666 sed -i 's#\(blazordevlab/cleanarchitectureblazorserver:\).*#\1${{ steps.version.outputs.version }}#' .github/workflows/deploy/docker-compose-db.yml
6767
68- - name : Set up Git
68+ - name : Create Pull Request
6969 if : github.event_name == 'push' && github.ref == 'refs/heads/main'
7070 run : |
71+ # Create a new branch with timestamp to avoid conflicts
72+ NEW_BRANCH="update-compose-version-${{ steps.version.outputs.version }}"
7173 git config --local user.email "action@github.com"
7274 git config --local user.name "GitHub Action"
75+ git checkout -b $NEW_BRANCH
7376
74- - name : Commit and push updated files
75- if : github.event_name == 'push' && github.ref == 'refs/heads/main'
76- run : |
77+ # Add, commit changes
7778 git add .github/workflows/deploy/docker-compose.yml .github/workflows/deploy/docker-compose-db.yml
7879 git commit -m "Update Docker Compose files to version ${{ steps.version.outputs.version }}"
79- git push origin main
80+ git push origin $NEW_BRANCH
81+
82+ - name : Create Pull Request with GitHub CLI
83+ if : github.event_name == 'push' && github.ref == 'refs/heads/main'
84+ env :
85+ GH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
86+ run : |
87+ NEW_BRANCH="update-compose-version-${{ steps.version.outputs.version }}"
88+ gh pr create --base main --head $NEW_BRANCH \
89+ --title "Update Docker Compose to version ${{ steps.version.outputs.version }}" \
90+ --body "Automatically updating Docker Compose version references to match the latest build version ${{ steps.version.outputs.version }}"
8091
You can’t perform that action at this time.
0 commit comments