Skip to content

Commit

Permalink
chore(cypress): add github workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
luisecm committed May 8, 2024
1 parent ed03003 commit 04d14b2
Show file tree
Hide file tree
Showing 5 changed files with 109 additions and 0 deletions.
17 changes: 17 additions & 0 deletions .github/workflows/add-label.yml
Original file line number Diff line number Diff line change
@@ -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 }}
21 changes: 21 additions & 0 deletions .github/workflows/avoid-typos.yml
Original file line number Diff line number Diff line change
@@ -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/*
26 changes: 26 additions & 0 deletions .github/workflows/fix-typos.yml
Original file line number Diff line number Diff line change
@@ -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 }}"
31 changes: 31 additions & 0 deletions .github/workflows/lint-PR-title.yml
Original file line number Diff line number Diff line change
@@ -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 == '' }}
14 changes: 14 additions & 0 deletions .github/workflows/remove-labels.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
with:
github_token: ${{ secrets.github_token }}

0 comments on commit 04d14b2

Please sign in to comment.