From 9a7bc53764f26186d8e47c78aa147cdead7acd4a Mon Sep 17 00:00:00 2001 From: MunJangHun <105299421+moondev03@users.noreply.github.com> Date: Wed, 7 Aug 2024 06:44:59 +0900 Subject: [PATCH] =?UTF-8?q?=E2=9A=99=EF=B8=8F=20GitHub=20Action=20|=20Upda?= =?UTF-8?q?te=20Increment=20Version=20Code=20Logic?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workflows/versioning-and-deployment.yaml | 29 ++++++++++++------- 1 file changed, 18 insertions(+), 11 deletions(-) diff --git a/.github/workflows/versioning-and-deployment.yaml b/.github/workflows/versioning-and-deployment.yaml index 3e96660..daa6b8c 100644 --- a/.github/workflows/versioning-and-deployment.yaml +++ b/.github/workflows/versioning-and-deployment.yaml @@ -39,7 +39,8 @@ jobs: git config --global user.name "${{ secrets.GIT_USER_NAME }}" git config --global user.email "${{ secrets.GIT_USER_EMAIL }}" git checkout -b version-update - git commit -am "[GitHub Action] Increment versionCode to $NEW_VERSION_CODE" + git add ./Nabi/presentation/build.gradle.kts + git commit -m "[GitHub Action] Increment versionCode to $NEW_VERSION_CODE" echo "changed=true" >> $GITHUB_ENV else echo "changed=false" >> $GITHUB_ENV @@ -57,25 +58,31 @@ jobs: merge_version_update: runs-on: ubuntu-latest needs: increment_version_code - if: needs.increment_version_code.outputs.changed == 'true' + if: env.changed == 'true' steps: - - name: Checkout code + - name: Checkout develop branch uses: actions/checkout@v4 + with: + ref: develop + fetch-depth: 0 - - name: Show current branch + - name: Configure Git run: | - echo "Current branch:" - git branch - echo "Fetching remote branches" - git fetch origin + git config user.name "${{ secrets.GIT_USER_NAME }}" + git config user.email "${{ secrets.GIT_USER_EMAIL }}" - name: Merge version-update branch run: | + git fetch origin git checkout develop - git merge origin/version-update - echo "Pushing changes to develop branch" - git push origin develop + git merge origin/version-update --no-edit + + - name: Push changes to develop branch + uses: ad-m/github-push-action@master + with: + branch: develop + github_token: ${{ secrets.HUBGIT_TOKEN }} build_and_upload: runs-on: ubuntu-latest