feat(install): Use existing directories and pull updates instead of e… #72
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: Enhance Commit Messages | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| types: [opened, synchronize] | |
| jobs: | |
| enhance-commits: | |
| if: "!contains(github.event.head_commit.message, '[auto-enhanced]') && !contains(github.event.head_commit.message, '[skip pages]') && !contains(github.event.head_commit.message, '[release]') && github.actor != 'github-pages[bot]' && github.actor != 'github-actions[bot]'" | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 | |
| token: ${{ secrets.COMMIT_ENHANCER_PAT }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v3 | |
| with: | |
| node-version: '18' | |
| - name: Install dependencies | |
| run: npm install @google/generative-ai axios | |
| - name: Configure Git | |
| run: | | |
| git config --global user.name "GitHub Actions Commit Enhancer" | |
| git config --global user.email "actions@github.com" | |
| - name: Enhance commit messages | |
| id: enhance | |
| env: | |
| GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }} | |
| GITHUB_TOKEN: ${{ secrets.COMMIT_ENHANCER_PAT }} # This is used by the script for PR updates | |
| run: node .github/scripts/enhance-commits.js |