Skip to content

Commit

Permalink
Fix automate process (#1280)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
Lee-W authored Aug 7, 2023
1 parent 4e6e21c commit bf38431
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 11 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/validate_release_commit.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down
12 changes: 2 additions & 10 deletions .github/workflows/release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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

0 comments on commit bf38431

Please sign in to comment.