diff --git a/.github/workflows/add-label.yml b/.github/workflows/add-label.yml new file mode 100644 index 00000000..fed497c2 --- /dev/null +++ b/.github/workflows/add-label.yml @@ -0,0 +1,17 @@ +name: Add Label +on: + pull_request: + types: + - opened +jobs: + add-label: + name: Add Label + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: christianvuerings/add-labels@v1 + with: + labels: | + Missing dev review + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/avoid-typos.yml b/.github/workflows/avoid-typos.yml new file mode 100644 index 00000000..f8f50343 --- /dev/null +++ b/.github/workflows/avoid-typos.yml @@ -0,0 +1,21 @@ +name: reviewdog +on: + pull_request: + types: [opened, synchronize, reopened, edited] + +jobs: + misspell: + name: runner / misspell + runs-on: ubuntu-latest + steps: + - name: Check out code. + uses: actions/checkout@v4 + - name: misspell + uses: reviewdog/action-misspell@v1 + with: + github_token: ${{ secrets.github_token }} + locale: "US" + reporter: github-pr-review + level: error + exclude: | + ./node_modules/* diff --git a/.github/workflows/fix-typos.yml b/.github/workflows/fix-typos.yml new file mode 100644 index 00000000..0cbf9009 --- /dev/null +++ b/.github/workflows/fix-typos.yml @@ -0,0 +1,26 @@ +name: Automatically fix typos +on: + push: + branches: + - dev + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + with: + ref: dev + - uses: sobolevn/misspell-fixer-action@master + - name: Create Pull Request + id: cpr + uses: peter-evans/create-pull-request@v6 + env: + ACTIONS_ALLOW_UNSECURE_COMMANDS: "true" + with: + token: ${{ secrets.GITHUB_TOKEN }} + - name: Check outputs of PR + if: ${{ steps.cpr.outputs.pull-request-number }} + run: | + echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" + echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" diff --git a/.github/workflows/lint-PR-title.yml b/.github/workflows/lint-PR-title.yml new file mode 100644 index 00000000..507f96fa --- /dev/null +++ b/.github/workflows/lint-PR-title.yml @@ -0,0 +1,31 @@ +name: Lint Pull Request Title + +on: + pull_request: + types: + - opened + - edited + - reopened + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - uses: actions-ecosystem/action-regex-match@v2 + id: regex-match + with: + text: ${{ github.event.pull_request.title }} + regex: '(?:add|update|screenobject|chore|test|fix)\([a-z-A-Z]+\):\s.+' + + - uses: actions-ecosystem/action-create-comment@v1 + if: ${{ steps.regex-match.outputs.match == '' }} + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + body: | + :warning: The title of this PR is invalid. + Please make the title match the regex `(?:add|update|screenobject|chore|test|fix)\([a-z-A-Z]+\):\s.+`. + e.g.) `add(cli): enable --verbose flag`, `fix(api): avoid unexpected error in handler` + - run: exit 1 + if: ${{ steps.regex-match.outputs.match == '' }} diff --git a/.github/workflows/remove-labels.yml b/.github/workflows/remove-labels.yml new file mode 100644 index 00000000..a2d8f77a --- /dev/null +++ b/.github/workflows/remove-labels.yml @@ -0,0 +1,14 @@ +name: Remove All Labels + +on: + pull_request: + types: [closed] + +jobs: + remove_labels: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: rogerluan/label-remover@v1.0.1 + with: + github_token: ${{ secrets.github_token }}