[Button] 隐私同意按钮与手机号验证耦合使用时,手机号对应事件无法触发 #1610
This file contains hidden or 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: Auto Release | |
on: | |
pull_request: | |
branches: [develop] | |
types: [opened, synchronize, reopened, closed] | |
paths: | |
- 'packages/tdesign-miniprogram/package.json' | |
issue_comment: | |
types: [edited] | |
jobs: | |
generator: | |
runs-on: ubuntu-latest | |
if: > | |
github.event_name == 'pull_request' && | |
github.event.pull_request.merged == false && | |
startsWith(github.head_ref, 'release/') | |
steps: | |
- run: echo "The head of this PR starts with 'release/'" | |
- uses: actions/checkout@v3 | |
- name: Extract version | |
id: version | |
run: | | |
echo "version=$(node -p 'require("./packages/tdesign-miniprogram/package.json").version')" >> $GITHUB_OUTPUT | |
- uses: TDesignOteam/tdesign-changelog-action@main | |
id: changelog | |
with: | |
tag: ${{ steps.version.outputs.version }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
- name: Add comment | |
uses: peter-evans/create-or-update-comment@v1 | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
${{ steps.changelog.outputs.changelog }} | |
comment_add_log: | |
runs-on: ubuntu-latest | |
if: > | |
github.event_name == 'issue_comment' | |
&& github.event.issue.pull_request | |
&& github.event.sender.login == github.event.issue.user.login | |
&& startsWith(github.event.comment.body, '## 🌈 ') | |
steps: | |
- id: comment | |
shell: bash | |
run: | | |
result=$(curl ${{github.event.issue.pull_request.url}} -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}") | |
headrefreg='"ref": "(release/[[:digit:]]{1,2}\.[[:digit:]]{1,2}\.[[:digit:]]{1,2})",' | |
if [[ $result =~ $headrefreg ]] | |
then | |
echo "属于 release pr 的 comment ${BASH_REMATCH[1]}" | |
else | |
echo "不属于 release pr 的 comment" && exit 1 | |
fi | |
echo "branch=${BASH_REMATCH[1]}" >> $GITHUB_OUTPUT | |
# zsh $match[1] | |
- uses: actions/checkout@v3 | |
with: | |
ref: ${{ steps.comment.outputs.branch }} | |
- name: Commit and push if needed | |
env: | |
BODY: ${{ github.event.comment.body }} | |
run: | | |
txt=$(cat packages/tdesign-miniprogram/CHANGELOG.md) | |
chat_txt=$(cat packages/tdesign-miniprogram-chat/CHANGELOG.md) | |
echo "${txt%%##*}$BODY${txt##*---}" > packages/tdesign-miniprogram/CHANGELOG.md | |
echo "${chat_txt%%##*}$BODY${chat_txt##*---}" > packages/tdesign-miniprogram-chat/CHANGELOG.md | |
git add . | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git commit -m "chore: changelog's changes" | |
git push | |
echo "💾 pushed changelog's changes" | |
merge_tag: | |
runs-on: ubuntu-latest | |
if: > | |
github.event_name == 'pull_request' && | |
github.event.pull_request.merged == true && | |
startsWith(github.head_ref, 'release/') | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: develop | |
token: ${{ secrets.PERSONAL_TOKEN }} | |
- name: tag and push if needed | |
run: | | |
data=$(cat packages/tdesign-miniprogram/package.json) | |
re="\"version\": \"([^\"]*)\"" | |
[[ $data =~ $re ]] | |
echo "${BASH_REMATCH[1]}" | |
git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
git config --local user.name "github-actions[bot]" | |
git tag ${BASH_REMATCH[1]} | |
git push origin ${BASH_REMATCH[1]} | |
echo "pushed tag ${BASH_REMATCH[1]}" |