Sweep: Optimize the README to make it look professional or polished #3
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: OpenIM Create Tag | |
on: | |
issue_comment: | |
types: [created] | |
pull_request_review_comment: | |
types: [created] | |
jobs: | |
create_tag: | |
runs-on: ubuntu-latest | |
if: startsWith(github.event.comment.body, '/create tag') | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Create tag | |
run: | | |
echo "Parsing comment for tag creation command..." | |
COMMENT_BODY="${{ github.event.comment.body }}" | |
TAG_REGEX='^\/create tag ([a-zA-Z0-9\.-]+) "(.*)"' | |
if [[ $COMMENT_BODY =~ $TAG_REGEX ]]; then | |
TAG=${BASH_REMATCH[1]} | |
TAG_MESSAGE=${BASH_REMATCH[2]} | |
echo "Creating tag $TAG with message: $TAG_MESSAGE" | |
git config --global user.name 'GitHub Actions' | |
git config --global user.email '[email protected]' | |
git tag -a $TAG -m "$TAG_MESSAGE" | |
git push origin $TAG | |
else | |
echo "No tag creation command found in comment." | |
fi |