diff --git a/.github/workflows/auto-approve.yml b/.github/workflows/auto-approve.yml new file mode 100644 index 00000000..a34e16bb --- /dev/null +++ b/.github/workflows/auto-approve.yml @@ -0,0 +1,20 @@ +name: Auto-approve PR +on: + pull_request_target: + types: [ opened, synchronize ] + pull_request: + types: [ opened, synchronize ] + +jobs: + auto-approve: + # Only run this action for the dorthrithil user + if: github.actor == 'dorthrithil' + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Auto-approve + uses: hmarr/auto-approve-action@v3 + with: + github-token: ${{ secrets.LC_BOT_PAT }} + review-message: "LocalCragBot here - I approved the PR!\n\nWondering why this is happening? Join the LocalCrag team and be the one approving PRs instead of me!" \ No newline at end of file diff --git a/.github/workflows/backend-unit-tests.yml b/.github/workflows/backend-unit-tests.yml index 8ab6d366..e9ee92e1 100644 --- a/.github/workflows/backend-unit-tests.yml +++ b/.github/workflows/backend-unit-tests.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - 'v[0-9]+.[0-9]+.[0-9]+' + - next jobs: backend-unit-tests: environment: Testing diff --git a/.github/workflows/check-frontend-prod-build.yml b/.github/workflows/check-frontend-prod-build.yml index a26473d7..af422aaa 100644 --- a/.github/workflows/check-frontend-prod-build.yml +++ b/.github/workflows/check-frontend-prod-build.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - 'v[0-9]+.[0-9]+.[0-9]+' + - next jobs: frontend-prod-build-check: runs-on: ubuntu-latest diff --git a/.github/workflows/check-migrate-from-empty-db.yml b/.github/workflows/check-migrate-from-empty-db.yml index 28bf301f..4d727403 100644 --- a/.github/workflows/check-migrate-from-empty-db.yml +++ b/.github/workflows/check-migrate-from-empty-db.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - 'v[0-9]+.[0-9]+.[0-9]+' + - next jobs: check-migrate-from-empty-db: environment: Testing diff --git a/.github/workflows/check-migrate-from-prod-db.yml b/.github/workflows/check-migrate-from-prod-db.yml index 80f24551..4fd79da6 100644 --- a/.github/workflows/check-migrate-from-prod-db.yml +++ b/.github/workflows/check-migrate-from-prod-db.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - 'v[0-9]+.[0-9]+.[0-9]+' + - next jobs: check-migrate-from-prod-db: environment: Testing diff --git a/.github/workflows/cypress-e2e-tests.yml b/.github/workflows/cypress-e2e-tests.yml index 5c3a4e9f..06c4b6a2 100644 --- a/.github/workflows/cypress-e2e-tests.yml +++ b/.github/workflows/cypress-e2e-tests.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - 'v[0-9]+.[0-9]+.[0-9]+' + - next jobs: cypress-run: runs-on: ubuntu-latest diff --git a/.github/workflows/frontend-unit-tests.yml b/.github/workflows/frontend-unit-tests.yml index 3070ef34..5be9615a 100644 --- a/.github/workflows/frontend-unit-tests.yml +++ b/.github/workflows/frontend-unit-tests.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - 'v[0-9]+.[0-9]+.[0-9]+' + - next jobs: frontend-unit-tests: runs-on: ubuntu-latest diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml index d5fc38cd..6a68af6e 100644 --- a/.github/workflows/linting.yml +++ b/.github/workflows/linting.yml @@ -3,7 +3,7 @@ on: pull_request: branches: - main - - 'v[0-9]+.[0-9]+.[0-9]+' + - next jobs: lint-server: runs-on: ubuntu-latest diff --git a/.github/workflows/pr-title-lint.yml b/.github/workflows/pr-title-lint.yml new file mode 100644 index 00000000..83e45323 --- /dev/null +++ b/.github/workflows/pr-title-lint.yml @@ -0,0 +1,34 @@ +# Enforces that the PR title follows the Conventional Commits specification +# https://www.conventionalcommits.org/en/v1.0.0/ +# The PR title is used as the commit message when squashing PRs (requires specific GitHub settings) + +name: "Conventional Commits PR Title" + +on: + pull_request: + branches: + - next + types: + - synchronize + - opened + - edited + - ready_for_review + +jobs: + check_squash_commit: + runs-on: ubuntu-latest + steps: + - name: Checkout PR branch + uses: actions/checkout@v4 + with: + ref: ${{ github.event.pull_request.head.sha }} + + - name: Extract PR title as squash commit message + run: echo "${{ github.event.pull_request.title }}" > squash_commit_message.txt + + - name: Install commitlint + run: npm install @commitlint/{config-conventional,cli} + + - name: Validate PR title as squash commit message + run: | + echo "${{ github.event.pull_request.title }}" | npx commitlint --verbose diff --git a/commitlint.config.js b/commitlint.config.js new file mode 100644 index 00000000..e424dbc5 --- /dev/null +++ b/commitlint.config.js @@ -0,0 +1,3 @@ +module.exports = { + extends: ['@commitlint/config-conventional'], +}; \ No newline at end of file