From 71764447ad19b0ed525376d0f813729add7711aa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Mon, 18 Dec 2023 11:38:52 +0800 Subject: [PATCH 1/3] =?UTF-8?q?chore:=20=E5=9B=9E=E6=BB=9A=20CONTRIBUTING?= =?UTF-8?q?=20=E6=96=87=E4=BB=B6=E8=B7=AF=E5=BE=84=20(#1465)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/ISSUE_TEMPLATE/bug-feature.yml | 2 +- .github/workflows/issue-labeled.yml | 2 +- .github/CONTRIBUTING.md => CONTRIBUTING.md | 0 3 files changed, 2 insertions(+), 2 deletions(-) rename .github/CONTRIBUTING.md => CONTRIBUTING.md (100%) diff --git a/.github/ISSUE_TEMPLATE/bug-feature.yml b/.github/ISSUE_TEMPLATE/bug-feature.yml index d8d5a9ff..dd8c4a2c 100644 --- a/.github/ISSUE_TEMPLATE/bug-feature.yml +++ b/.github/ISSUE_TEMPLATE/bug-feature.yml @@ -10,7 +10,7 @@ body: required: true - label: 我确认已在 [Issues](https://github.com/layui/layui/issues?q=is%3Aissue ) 中搜索过类似的问题,但没有找到相关解决方案。 required: true - - label: 我已仔细阅读: 🍀[ Layui Issue 贡献指南](https://github.com/layui/layui/blob/main/.github/CONTRIBUTING.md) + - label: 我已仔细阅读: 🍀[ Layui Issue 贡献指南](https://github.com/layui/layui/blob/main/CONTRIBUTING.md) required: true - type: dropdown id: type diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 86828ab2..ebb725fa 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -17,7 +17,7 @@ jobs: - name: content template id: template run: | - DIR_NAME="详见:🍀 [Layui Issue 贡献指南](https://github.com/layui/layui/blob/main/.github/CONTRIBUTING.md)" + DIR_NAME="详见:🍀 [Layui Issue 贡献指南](https://github.com/layui/layui/blob/main/CONTRIBUTING.md)" echo "CONTRIBUTING=$DIR_NAME" >> $GITHUB_OUTPUT - name: help wanted diff --git a/.github/CONTRIBUTING.md b/CONTRIBUTING.md similarity index 100% rename from .github/CONTRIBUTING.md rename to CONTRIBUTING.md From 7b5a09b379f733233d67ba9cee34034f8213a4e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9D=92=E5=B4=96?= <33601030+bxjt123@users.noreply.github.com> Date: Tue, 19 Dec 2023 10:20:56 +0800 Subject: [PATCH 2/3] =?UTF-8?q?style:=20=E4=BC=98=E5=8C=96=E8=BE=93?= =?UTF-8?q?=E5=85=A5=E6=A1=86=E5=9C=86=E8=A7=92=E6=97=B6=E5=90=8E=E7=BC=80?= =?UTF-8?q?=E5=AD=98=E5=9C=A8=E6=96=B9=E6=A1=86=E7=9A=84=E9=97=AE=E9=A2=98?= =?UTF-8?q?=20(#1467)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 优化输入框圆角时后缀存在方框的问题 --- src/css/layui.css | 1 + 1 file changed, 1 insertion(+) diff --git a/src/css/layui.css b/src/css/layui.css index 43d45916..8622f364 100644 --- a/src/css/layui.css +++ b/src/css/layui.css @@ -816,6 +816,7 @@ hr.layui-border-black{border-width: 0 0 1px;} .layui-input-wrap .layui-input:focus + .layui-input-split{border-color: #16b777;} .layui-input-wrap .layui-input.layui-form-danger:focus + .layui-input-split{border-color: #ff5722;} .layui-input-wrap .layui-input-prefix.layui-input-split{border-width: 0; border-right-width: 1px;} +.layui-input-wrap .layui-input-suffix.layui-input-split{border-width: 0; border-left-width: 1px;} /* 输入框动态点缀 */ .layui-input-affix{line-height: 38px;} From 1fdc84c498df088dfdcea555cb6e567020928e8b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E8=B4=A4=E5=BF=83?= <3277200+sentsim@users.noreply.github.com> Date: Wed, 20 Dec 2023 11:32:42 +0800 Subject: [PATCH 3/3] =?UTF-8?q?ci(issue):=20=E6=96=B0=E5=A2=9E=E5=92=8C?= =?UTF-8?q?=E4=BC=98=E5=8C=96=E5=A4=9A=E4=B8=AA=20workflow=20(#1475)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * chore: 增加 issue 模板特定标识 * ci(issue): 修改 issue 不活跃状态天数 * refactor: 修改 Issue Labeled 任务变量名 * style: 段落优化 * ci: 新增 Issue 创建和编辑时的 action * ci: 新增 Issue 关闭时的 action --- .github/ISSUE_TEMPLATE/bug-feature.yml | 2 +- .github/workflows/issue-close-require.yml | 10 ++-- .github/workflows/issue-closed.yml | 34 +++++++++++++ .github/workflows/issue-labeled.yml | 4 +- .github/workflows/issue-opened.yml | 60 +++++++++++++++++++++++ .github/workflows/release.yml | 4 +- 6 files changed, 104 insertions(+), 10 deletions(-) create mode 100644 .github/workflows/issue-closed.yml create mode 100644 .github/workflows/issue-opened.yml diff --git a/.github/ISSUE_TEMPLATE/bug-feature.yml b/.github/ISSUE_TEMPLATE/bug-feature.yml index dd8c4a2c..ec8be1e3 100644 --- a/.github/ISSUE_TEMPLATE/bug-feature.yml +++ b/.github/ISSUE_TEMPLATE/bug-feature.yml @@ -60,5 +60,5 @@ body: attributes: label: 友好承诺 options: - - label: 我承诺将本着相互尊重、理解和友善的态度进行交流,共同维护 Layui 良好的社区氛围。 + - label: 我承诺将本着相互尊重、理解和友善的态度进行交流,共同维护 Layui 良好的社区氛围。 required: true diff --git a/.github/workflows/issue-close-require.yml b/.github/workflows/issue-close-require.yml index 8ac4083c..03ac5792 100644 --- a/.github/workflows/issue-close-require.yml +++ b/.github/workflows/issue-close-require.yml @@ -19,12 +19,12 @@ jobs: with: actions: 'close-issues' labels: 'need reproduce' - inactive-day: 5 + inactive-day: 3 body: | - 由于超过 5 天仍未收到相关重现,该 issue 已被自动关闭。 - - name: resolved + 由于超过 3 天仍未收到相关重现或其他更多信息,该 issue 已被自动关闭。 + - name: Close inactive issues within 7 days uses: actions-cool/issues-helper@v3 with: actions: 'close-issues' - labels: 'resolved' - inactive-day: 3 + labels: 'compatibility,discussion,resolved,unrelated,usage' + inactive-day: 7 diff --git a/.github/workflows/issue-closed.yml b/.github/workflows/issue-closed.yml new file mode 100644 index 00000000..4e03788d --- /dev/null +++ b/.github/workflows/issue-closed.yml @@ -0,0 +1,34 @@ +name: Issue Closed + +on: + issues: + types: [closed] + +jobs: + issue-closed: + runs-on: ubuntu-latest + steps: + # 追加标签 + - name: Add labels + id: label-check + uses: actions/github-script@v7 + with: + github-token: ${{secrets.GITHUB_TOKEN}} + script: | + const config = { + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }; + const issue = await github.rest.issues.get(config); + + // 是否带有 `bug` 标签 + const hasBugLabel = issue.data.labels.some(label => label.name === 'bug'); + + // 对带有 `bug` 标签的 issue 追加 `resolved` 标签,表示 bug 已解决。 + if (hasBugLabel) { + github.rest.issues.addLabels({ + ...config, + labels: ['resolved'] + }); + } diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index ebb725fa..447e5649 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -17,8 +17,8 @@ jobs: - name: content template id: template run: | - DIR_NAME="详见:🍀 [Layui Issue 贡献指南](https://github.com/layui/layui/blob/main/CONTRIBUTING.md)" - echo "CONTRIBUTING=$DIR_NAME" >> $GITHUB_OUTPUT + contribute="详见:🍀 [Layui Issue 贡献指南](https://github.com/layui/layui/blob/main/CONTRIBUTING.md)" + echo "CONTRIBUTING=$contribute" >> $GITHUB_OUTPUT - name: help wanted if: github.event.label.name == 'help wanted' diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml new file mode 100644 index 00000000..e439ed4c --- /dev/null +++ b/.github/workflows/issue-opened.yml @@ -0,0 +1,60 @@ +name: Issue opened + +on: + issues: + types: [opened, edited] + +permissions: + contents: read + +jobs: + issue-opened: + permissions: + issues: write + pull-requests: write + runs-on: ubuntu-latest + steps: + - name: content template + id: template + run: | + contribute="详见:🍀 [Layui Issue 贡献指南](https://github.com/layui/layui/blob/main/CONTRIBUTING.md)" + echo "CONTRIBUTING=$contribute" >> $GITHUB_ENV + + - name: check invalid + uses: actions/github-script@v7 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} + script: | + const config = { + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: context.issue.number, + }; + + const issue = context.payload.issue; + const issueBody = issue.body; + const requiredString = "layui-issue-template"; + const isCreatedByBot = context.payload.sender.type === 'Bot'; + const isValid = issueBody.includes(requiredString); + + // 跳过 closed 状态的 issues + if (issue.state === 'closed') { + return console.log('Issue is closed.'); + } + + // 不符合规则或由机器人创建 + if (!isValid || isCreatedByBot) { + github.rest.issues.createComment({ + ...config, + body: `@${context.payload.sender.login} 你好,为了提升沟通效率,我们对 Issue 制定了严格的要求,你的 Issue 因不符合规定而被自动关闭。 + 建议您在下次创建 Issue 时,遵循相应规范和社区行为准则。谢谢。\n > ${process.env.CONTRIBUTING}` + }); + github.rest.issues.addLabels({ + ...config, + labels: ['invalid'] + }); + github.rest.issues.update({ + ...config, + state: 'closed' + }); + } diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 6d0450f8..f77362ef 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -1,10 +1,10 @@ +name: Create Release + on: push: tags: - 'v*' -name: Create Release - jobs: build: name: Create Release