From 633e91e321df0af0b63073fd959a464118b7b983 Mon Sep 17 00:00:00 2001 From: Marcin Sawicki Date: Tue, 10 Sep 2024 14:27:03 +0200 Subject: [PATCH] test(Release): test --- .github/workflows/release-test.yml | 43 ++++++++++++++++++++++++++---- 1 file changed, 38 insertions(+), 5 deletions(-) diff --git a/.github/workflows/release-test.yml b/.github/workflows/release-test.yml index fb2806f95..aa23b007b 100644 --- a/.github/workflows/release-test.yml +++ b/.github/workflows/release-test.yml @@ -64,15 +64,48 @@ jobs: # NPM_TOKEN: ${{ secrets.NPM_TOKEN }}, # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - - name: Push changes back to the repo - run: | - git push origin --follow-tags - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + # - name: Push changes back to the repo + # run: | + # git push origin --follow-tags + # env: + # GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + # - name: Pull latest changes from remote + # run: git pull origin release-test + + # - name: Create merge-back PR to main + # uses: peter-evans/create-pull-request@v5 + # with: + # token: ${{ secrets.GITHUB_TOKEN }} + # commit-message: "Release - version update" + # branch: release-test + # base: main + # title: 'Release - version update' + # body: 'This is an automated PR to merge the release branch into main after version bump and publish.' + + - name: Checkout current branch (release-test) + uses: actions/checkout@v2 + with: + ref: release-test # Replace with the actual release branch if different - name: Pull latest changes from remote run: git pull origin release-test + - name: Commit changes (if any) + run: | + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git add . + git diff-index --quiet HEAD || git commit -m "Version bump and changes" + + - name: Check for changes between release-test and main + run: | + git fetch origin main + if [ "$(git rev-list --count release-test..origin/main)" -eq 0 ]; then + echo "No changes to merge. Skipping PR creation." + exit 0 + fi + - name: Create merge-back PR to main uses: peter-evans/create-pull-request@v5 with: