refactor!: all codebase for production usage #38
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: PR Automation | |
| on: | |
| pull_request: | |
| types: [opened, edited, synchronize, ready_for_review] | |
| pull_request_review: | |
| types: [submitted] | |
| issue_comment: | |
| types: [created] | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| issues: write | |
| jobs: | |
| pr-title-lint: | |
| name: PR Title Lint | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: '20' | |
| - name: Install commitlint | |
| run: | | |
| npm install --save-dev @commitlint/cli @commitlint/config-conventional | |
| - name: Create commitlint config | |
| run: | | |
| echo "module.exports = {extends: ['@commitlint/config-conventional']}" > commitlint.config.js | |
| - name: Lint PR title | |
| env: | |
| PR_TITLE: ${{ github.event.pull_request.title }} | |
| run: | | |
| echo "$PR_TITLE" | npx commitlint | |
| pr-labeler: | |
| name: PR Labeler | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' | |
| steps: | |
| - name: Label PR based on files changed | |
| uses: actions/labeler@v5 | |
| with: | |
| repo-token: '${{ secrets.GITHUB_TOKEN }}' | |
| configuration-path: .github/labeler.yml |