From bf38431ba4d8dce313b620dd3996c14b266115cf Mon Sep 17 00:00:00 2001 From: Wei Lee Date: Mon, 7 Aug 2023 16:30:43 +0800 Subject: [PATCH] Fix automate process (#1280) * change the regex to check the release commit to include the PR number * remove bump dev version for now as it will fail due to commitizen behavior * use BOT_ACCESS_TOKEN to push the git tag --- .github/scripts/validate_release_commit.py | 2 +- .github/workflows/release.yaml | 12 ++---------- 2 files changed, 3 insertions(+), 11 deletions(-) diff --git a/.github/scripts/validate_release_commit.py b/.github/scripts/validate_release_commit.py index 274b49c34..bdeeda7e2 100644 --- a/.github/scripts/validate_release_commit.py +++ b/.github/scripts/validate_release_commit.py @@ -2,7 +2,7 @@ import sys if __name__ == "__main__": - pattern = r"^Release \d{1,}\.\d{1,}\.\d{1,}$" + pattern = r"^Release \d{1,}\.\d{1,}\.\d{1,}( \(#\d+\)){0,1}$" if len(sys.argv) == 2: commit_message = sys.argv[1] if not re.fullmatch(pattern, commit_message): diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index 1209b6fab..765781db9 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -14,14 +14,14 @@ jobs: - name: Check out uses: actions/checkout@v3 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.BOT_ACCESS_TOKEN }} - name: Check head commit message id: check_head_commit_message continue-on-error: true run: | head_commit_message=`git log --format=%s -1` - python ./.github/scripts/validate_release_commit.py $head_commit_message + python ./.github/scripts/validate_release_commit.py "$head_commit_message" if [ $? -eq 1 ] then echo "valid_release_message=False" >> $GITHUB_OUTPUT @@ -45,11 +45,3 @@ jobs: run: | git tag `cz version -p` git push origin `cz version -p` - - - name: Bump version for new development - if: ${{ steps.check_head_commit_message.outputs.valid_release_message == 'True' }} - run: | - make ASTRO_PROVIDER_VERSION=dev bump-version - git add . - git commit -m "Bump version to `cz version -p`" - git push origin main