-
Notifications
You must be signed in to change notification settings - Fork 66
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* ci: add some workflows * fix: fix spelling errors
- Loading branch information
Showing
21 changed files
with
269 additions
and
52 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
* @anlyyao @ZWkang @jarmywang |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
blank_issues_enabled: true | ||
contact_links: | ||
- name: 使用 issue-helper 新建 | ||
url: https://Tencent.github.io/tdesign/issue-helper/?lang=zh-CN&repo=Tencent/tdesign-mobile-react | ||
about: 使用 https://Tencent.github.io/tdesign/issue-helper/ 创建 issue,其中包含 bug 和 feature,表单提交更加严格。 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
## IssueShoot | ||
- 预估时长: {{ .duration }} | ||
- 期望完成时间: {{ .deadline }} | ||
- 开发难度: {{ .level }} | ||
- 参与人数: 1 | ||
- 需求对接人: anlyyao | ||
- 验收标准: 实现期望改造效果,提 PR 并通过验收无误 | ||
- 备注: 最终激励以实际提交 `pull request` 并合并为准 |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
name: issue on label | ||
on: | ||
issues: | ||
types: ['labeled'] | ||
jobs: | ||
add-issueshoot-template: | ||
runs-on: ubuntu-latest | ||
if: contains(fromJSON('["easy", "middle", "hard"]'), github.event.label.name) | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
- name: Get token | ||
id: token | ||
run: | | ||
label=${{ github.event.label.name }} | ||
if [[ $label = "easy" ]] | ||
then | ||
echo "level=低" >> $GITHUB_OUTPUT | ||
echo "duration=1" >> $GITHUB_OUTPUT | ||
deadline=$(date -d "+3 days" +'%Y-%m-%d') | ||
echo "deadline=${deadline}" >> $GITHUB_OUTPUT | ||
elif [[ $label = "middle" ]] | ||
then | ||
echo "level=中" >> $GITHUB_OUTPUT | ||
echo "duration=3" >> $GITHUB_OUTPUT | ||
deadline=$(date -d "+7 days" +'%Y-%m-%d') | ||
echo "deadline=${deadline}" >> $GITHUB_OUTPUT | ||
else | ||
echo "level=高" >> $GITHUB_OUTPUT | ||
echo "duration=5" >> $GITHUB_OUTPUT | ||
deadline=$(date -d "+10 days" +'%Y-%m-%d') | ||
echo "deadline=${deadline}" >> $GITHUB_OUTPUT | ||
fi | ||
- name: Create template | ||
id: template | ||
uses: chuhlomin/[email protected] | ||
with: | ||
template: .github/issue-shoot.md | ||
vars: | | ||
level: ${{ steps.token.outputs.level }} | ||
duration: ${{ steps.token.outputs.duration }} | ||
deadline: ${{ steps.token.outputs.deadline }} | ||
- name: Update issue | ||
uses: actions-cool/issues-helper@v3 | ||
with: | ||
actions: 'update-issue' | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
issue-number: ${{ github.event.issue.number }} | ||
body: ${{ steps.template.outputs.result }} | ||
update-mode: 'append' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,95 @@ | ||
name: PR_COMMENT_CI | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
check: | ||
runs-on: ubuntu-latest | ||
outputs: | ||
next_action: ${{ steps.get-action.outputs.next_action }} | ||
if: ${{ github.event.issue.pull_request }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 1 | ||
- uses: actions/github-script@v7 | ||
id: get-action | ||
with: | ||
script: | | ||
const user = context.payload.comment.user.login | ||
core.debug(`user: ${user}`) | ||
const fs = require('fs') | ||
const CODEOWNERS = fs.readFileSync('.github/CODEOWNERS', 'utf8') | ||
core.debug(`CODEOWNERS: ${CODEOWNERS}`) | ||
let isReviewer = false; | ||
CODEOWNERS.match(/@\w+/g).forEach((owner) => { | ||
if (owner === `@${user}`) { | ||
isReviewer = true | ||
} | ||
}) | ||
let next_action = '' | ||
if (isReviewer) { | ||
const body = context.payload.comment.body | ||
core.info(`body: ${body}`) | ||
if (body.startsWith('/update-common')) { | ||
next_action='update-common' | ||
} | ||
if (body.startsWith('/update-snapshot')) { | ||
next_action='update-snapshot' | ||
} | ||
} else { | ||
core.warning('You are not collaborator'); | ||
} | ||
core.info(`next_action: ${next_action}`) | ||
core.setOutput('next_action', next_action) | ||
update-common: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.check.outputs.next_action == 'update-common' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.PERSONAL_TOKEN }} | ||
- name: gh checkout pr | ||
env: | ||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | ||
run: gh pr checkout ${{ github.event.issue.number }} --recurse-submodules | ||
- run: git submodule update --remote --merge | ||
- name: Commit Common | ||
run: | | ||
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: update common" | ||
git push | ||
update-snapshot: | ||
needs: check | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.check.outputs.next_action == 'update-snapshot' }} | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
token: ${{ secrets.PERSONAL_TOKEN }} | ||
- name: gh checkout pr | ||
env: | ||
GH_TOKEN: ${{ secrets.PERSONAL_TOKEN }} | ||
run: gh pr checkout ${{ github.event.issue.number }} --recurse-submodules | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 18 | ||
- run: npm install | ||
- run: npm run test:update | ||
- name: Commit Snapshot | ||
run: | | ||
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: update snapshot" | ||
git push |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
name: Compressed Size | ||
|
||
on: | ||
pull_request: | ||
types: [opened, synchronize] | ||
|
||
jobs: | ||
compressed-size: | ||
runs-on: ubuntu-latest | ||
if: startsWith(github.head_ref, 'release/') | ||
steps: | ||
- uses: actions/checkout@v3 | ||
with: | ||
submodules: recursive | ||
- uses: 94dreamer/compressed-size-action@master | ||
with: | ||
repo-token: '${{ secrets.GITHUB_TOKEN }}' | ||
pattern: './dist/**/*.{js,css}' |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
name: pr-spell-check | ||
on: [pull_request] | ||
|
||
jobs: | ||
run: | ||
name: Spell Check with Typos | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Check spelling | ||
uses: crate-ci/typos@master | ||
with: | ||
config: .github/workflows/typos-config.toml |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
default.check-filename = true | ||
|
||
[default.extend-words] | ||
actived = "actived" | ||
colum = "colum" | ||
|
||
[files] | ||
extend-exclude = ["CHANGELOG.md", "*.snap"] |
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
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
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
Oops, something went wrong.