From 4e9add5e7e98013c131d9567f800cfe01b4645e0 Mon Sep 17 00:00:00 2001 From: yaozm Date: Tue, 30 Apr 2024 20:32:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9B=B4=E6=96=B0=E4=BE=9D=E8=B5=96=E9=85=8D?= =?UTF-8?q?=E7=BD=AE=E4=B8=8E=E5=B7=A5=E4=BD=9C=E6=B5=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/dependabot.yml | 2 +- .github/workflows/dependabot-auto-merge.yml | 31 +++++++++++++++++++++ .github/workflows/lint-md.yml | 24 ++++++++++++---- 3 files changed, 50 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/dependabot-auto-merge.yml diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 4dc11cb7..845eca6d 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -12,4 +12,4 @@ updates: schedule: interval: daily time: "21:00" - open-pull-requests-limit: 10 \ No newline at end of file + open-pull-requests-limit: 10 diff --git a/.github/workflows/dependabot-auto-merge.yml b/.github/workflows/dependabot-auto-merge.yml new file mode 100644 index 00000000..7f288365 --- /dev/null +++ b/.github/workflows/dependabot-auto-merge.yml @@ -0,0 +1,31 @@ +name: dependabot-auto-merge +on: pull_request_target + +permissions: + pull-requests: write + contents: write + +jobs: + dependabot: + runs-on: ubuntu-latest + if: ${{ github.actor == 'dependabot[bot]' }} + steps: + - name: Dependabot metadata + id: metadata + uses: dependabot/fetch-metadata@v2.0.0 + with: + github-token: "${{ secrets.GITHUB_TOKEN }}" + + - name: Auto-merge Dependabot PRs for semver-minor updates + if: ${{steps.metadata.outputs.update-type == 'version-update:semver-minor'}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - name: Auto-merge Dependabot PRs for semver-patch updates + if: ${{steps.metadata.outputs.update-type == 'version-update:semver-patch'}} + run: gh pr merge --auto --merge "$PR_URL" + env: + PR_URL: ${{github.event.pull_request.html_url}} + GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}} diff --git a/.github/workflows/lint-md.yml b/.github/workflows/lint-md.yml index 6064ee3b..815a32a5 100644 --- a/.github/workflows/lint-md.yml +++ b/.github/workflows/lint-md.yml @@ -7,11 +7,23 @@ jobs: runs-on: ubuntu-latest steps: - name: Checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - - name: lint-md-github-action - uses: lint-md/github-action@v0.1.1 + - name: Set node version + uses: actions/setup-node@v4 + + - name: Install dependencies + run: npm install + + - name: Lint markdown + run: npm run md-fix + + - name: Lint zh_CN + run: npm run zh-fix + + - name: Commit changes + uses: stefanzweifel/git-auto-commit-action@v5 with: - configFile: .lintmdrc - failOnWarnings: false - files: ./ ./.github/ + commit_options: '--no-verify' + commit_message: Fix markdown + file_pattern: '*.md */*.md */*/*.md'