From 78fd9c133e30ce2bff3228a14e05720616b4a175 Mon Sep 17 00:00:00 2001 From: Chawye Hsu Date: Sun, 30 Aug 2026 00:01:21 +0800 Subject: [PATCH] (chore): add lint-pr workflow and use pinned actions Signed-off-by: Chawye Hsu --- .github/workflows/excavator.yml | 18 +++++++++--------- .github/workflows/issue_comment.yml | 23 ----------------------- .github/workflows/issues.yml | 19 +++++++++---------- .github/workflows/lint-pr.yml | 16 ++++++++++++++++ .github/workflows/pull_request.yml | 20 +++++++++++--------- 5 files changed, 45 insertions(+), 51 deletions(-) delete mode 100644 .github/workflows/issue_comment.yml create mode 100644 .github/workflows/lint-pr.yml diff --git a/.github/workflows/excavator.yml b/.github/workflows/excavator.yml index 566ba6b38..8296197db 100644 --- a/.github/workflows/excavator.yml +++ b/.github/workflows/excavator.yml @@ -3,7 +3,8 @@ name: Excavator on: workflow_dispatch: schedule: - - cron: '0 */4 * * *' + # run every 4 hours + - cron: '20 */4 * * *' permissions: contents: write @@ -13,11 +14,10 @@ jobs: name: Excavate runs-on: windows-latest steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: Excavate - uses: ScoopInstaller/GithubActions@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SKIP_UPDATED: '1' - SCOOP_BRANCH: develop + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Excavate + uses: ScoopInstaller/GithubActions@5bceeda181721d9d10a18fdcc3ddca6f33467ae6 # v3.0.0 + env: + SKIP_UPDATED: 1 + SCOOP_BRANCH: develop diff --git a/.github/workflows/issue_comment.yml b/.github/workflows/issue_comment.yml deleted file mode 100644 index c3dc4b362..000000000 --- a/.github/workflows/issue_comment.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Commented Pull Request - -on: - issue_comment: - types: [ created ] - -permissions: - contents: read - pull-requests: write - -jobs: - pullRequestHandler: - name: PullRequestHandler - runs-on: windows-latest - steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: PullRequestHandler - uses: ScoopInstaller/GithubActions@main - if: startsWith(github.event.comment.body, '/verify') - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SCOOP_BRANCH: develop diff --git a/.github/workflows/issues.yml b/.github/workflows/issues.yml index 63ff45a39..9b8471963 100644 --- a/.github/workflows/issues.yml +++ b/.github/workflows/issues.yml @@ -2,7 +2,7 @@ name: Issues on: issues: - types: [ opened, labeled ] + types: [opened, labeled] permissions: # Auto hash fixing commits @@ -11,14 +11,13 @@ permissions: jobs: issueHandler: - name: IssueHandler + name: Issue Handler + if: github.event.action == 'opened' || (github.event.action == 'labeled' && contains(github.event.issue.labels.*.name, 'verify')) runs-on: windows-latest steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: IssueHandler - uses: ScoopInstaller/GithubActions@main - if: github.event.action == 'opened' || (github.event.action == 'labeled' && contains(github.event.issue.labels.*.name, 'verify')) - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SCOOP_BRANCH: develop + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Run Issue Handler + uses: ScoopInstaller/GithubActions@5bceeda181721d9d10a18fdcc3ddca6f33467ae6 # v3.0.0 + env: + SCOOP_BRANCH: develop diff --git a/.github/workflows/lint-pr.yml b/.github/workflows/lint-pr.yml new file mode 100644 index 000000000..add443432 --- /dev/null +++ b/.github/workflows/lint-pr.yml @@ -0,0 +1,16 @@ +name: Lint Pull Request + +on: + pull_request: + types: [opened, edited, synchronize] + +permissions: + pull-requests: read + +jobs: + pr-title: + name: Validate PR Title + runs-on: ubuntu-latest + steps: + - name: Check PR Title + uses: ScoopInstaller/GithubActions/lint-pr-title@5bceeda181721d9d10a18fdcc3ddca6f33467ae6 # v3.0.0 diff --git a/.github/workflows/pull_request.yml b/.github/workflows/pull_request.yml index f8ad8b732..9616c76c0 100644 --- a/.github/workflows/pull_request.yml +++ b/.github/workflows/pull_request.yml @@ -2,7 +2,9 @@ name: Pull Requests on: pull_request: - types: [ opened ] + types: [opened] + issue_comment: + types: [created] permissions: contents: read @@ -10,13 +12,13 @@ permissions: jobs: pullRequestHandler: - name: PullRequestHandler + name: Pull Request Handler + if: github.event_name == 'pull_request' || (github.event.issue.pull_request && startsWith(github.event.comment.body, '/verify')) runs-on: windows-latest steps: - - name: Checkout - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 - - name: PullRequestHandler - uses: ScoopInstaller/GithubActions@main - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - SCOOP_BRANCH: develop + - name: Checkout + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 + - name: Run Pull Request Handler + uses: ScoopInstaller/GithubActions@5bceeda181721d9d10a18fdcc3ddca6f33467ae6 # v3.0.0 + env: + SCOOP_BRANCH: develop