From 20f27f6a7f1fcecc377135b437d8cf40e9607d12 Mon Sep 17 00:00:00 2001 From: syaiful-aa Date: Fri, 28 Jun 2024 13:27:26 +0700 Subject: [PATCH] up --- .github/workflows/update-main-version.yml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/.github/workflows/update-main-version.yml b/.github/workflows/update-main-version.yml index 2ce73fe..55f0645 100644 --- a/.github/workflows/update-main-version.yml +++ b/.github/workflows/update-main-version.yml @@ -23,13 +23,13 @@ jobs: - uses: actions/checkout@v3 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.pull_request.merge_commit_sha }} - name: Get version id: get-version run: | git fetch origin main - prev_version=$(git show main:pubspec.yaml | grep 'version:' | cut -d ':' -f2 | sed 's/ //' | cut -d'+' -f1) + prev_version=$(git show origin/main:pubspec.yaml | grep 'version:' | cut -d ':' -f2 | sed 's/ //' | cut -d'+' -f1) echo "prev_version=$prev_version" >> $GITHUB_OUTPUT full_version=$(cat pubspec.yaml | grep 'version' | cut -d ':' -f2 | sed 's/ //' | cut -d'+' -f1) @@ -45,12 +45,17 @@ jobs: steps: - uses: actions/checkout@v3 with: - ref: ${{ github.event.pull_request.head.sha }} + ref: ${{ github.event.pull_request.merge_commit_sha }} - name: Tag new target run: | - git tag -f v${{ needs.validate_version.outputs.full_version }} ${{ github.event.pull_request.head.sha }} - git tag -f v${{ needs.validate_version.outputs.major_version }} ${{ github.event.pull_request.head.sha }} + git config user.email "action@github.com" + git config user.name "GitHub Action" + + message="${{ github.event.pull_request.title }}" + + git tag -f v${{ needs.validate_version.outputs.full_version }} -m $message + git tag -f v${{ needs.validate_version.outputs.major_version }} -m $message - name: Push new tag run: |