From 157b5d7f0eeba38be01d940bfb1449eb90b4eac9 Mon Sep 17 00:00:00 2001 From: Chris Grieser <73286100+chrisgrieser@users.noreply.github.com> Date: Tue, 17 Dec 2024 23:35:14 +0100 Subject: [PATCH] ci: stylua check instead of formatting; tweak pr title and stale bot --- .../{semantic-pr-title.yml => pr-title.yml} | 20 ++++++++++++------- .github/workflows/stale-bot.yml | 8 ++++---- .github/workflows/stylua.yml | 14 +++++-------- 3 files changed, 22 insertions(+), 20 deletions(-) rename .github/workflows/{semantic-pr-title.yml => pr-title.yml} (61%) diff --git a/.github/workflows/semantic-pr-title.yml b/.github/workflows/pr-title.yml similarity index 61% rename from .github/workflows/semantic-pr-title.yml rename to .github/workflows/pr-title.yml index e2f0777..3859f1f 100644 --- a/.github/workflows/semantic-pr-title.yml +++ b/.github/workflows/pr-title.yml @@ -1,21 +1,29 @@ -name: Ensure Conventional Commits-like PR titles +name: PR title on: pull_request_target: - types: [opened, edited, synchronize] + types: + - opened + - edited + - synchronize + - reopened + - ready_for_review permissions: pull-requests: read jobs: semantic-pull-request: - name: Validate PR title + name: Check PR title runs-on: ubuntu-latest steps: - uses: amannn/action-semantic-pull-request@v5 - # add `improv` to the list of allowed types + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} with: - types: | + requireScope: false + subjectPattern: ^(?![A-Z]).+$ # disallow title starting with capital + types: | # add `improv` to the list of allowed types improv fix feat @@ -29,5 +37,3 @@ jobs: docs break revert - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/stale-bot.yml b/.github/workflows/stale-bot.yml index 093048e..215db88 100644 --- a/.github/workflows/stale-bot.yml +++ b/.github/workflows/stale-bot.yml @@ -1,4 +1,4 @@ -name: "Close stale issues and PRs" +name: Stale bot on: schedule: - cron: "18 04 * * 3" @@ -11,13 +11,13 @@ jobs: stale: runs-on: ubuntu-latest steps: - - name: Close Stale Issues + - name: Close stale issues uses: actions/stale@v9 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - # DOCS https://github.com/actions/stale?tab=readme-ov-file#all-options - days-before-stale: 180 # ~6 months + # DOCS https://github.com/actions/stale#all-options + days-before-stale: 180 days-before-close: 7 stale-issue-label: "Stale" stale-issue-message: | diff --git a/.github/workflows/stylua.yml b/.github/workflows/stylua.yml index 1f16483..5665e2b 100644 --- a/.github/workflows/stylua.yml +++ b/.github/workflows/stylua.yml @@ -1,15 +1,14 @@ -name: Format with Stylua +name: Stylua check on: push: branches: [main] paths: ["**.lua"] - -permissions: - contents: write + pull_request: jobs: - postprocessing: + stylua: + name: Stylua runs-on: ubuntu-latest steps: - uses: actions/checkout@v4 @@ -17,7 +16,4 @@ jobs: with: token: ${{ secrets.GITHUB_TOKEN }} version: latest - args: . - - uses: stefanzweifel/git-auto-commit-action@v5 - with: - commit_message: "style: auto-format with stylua" + args: --check .