Update and rename colin.yml to auto-document.yml #1
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: Improve Code Comments | |
| on: | |
| push: | |
| branches: | |
| - main | |
| workflow_dispatch: | |
| permissions: | |
| contents: write | |
| pull-requests: write | |
| models: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| run-script: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| # Cache the generated model requests made by GenAIScript | |
| # | |
| # A new cache is created for each run to ensure that the latest model requests are used, | |
| # but previous caches can be restored and reused if availble. | |
| - uses: actions/cache@v4 | |
| with: | |
| path: .genaiscript/cache/** | |
| key: genaiscript-${{ github.run_id }} | |
| restore-keys: genaiscript- | |
| - uses: pelikhan/action-genai-commentor@main | |
| with: | |
| github_token: ${{ secrets.GITHUB_TOKEN }} | |
| update_existing: true | |
| max_edits: 10 | |
| # Create a pull request with the changes | |
| - name: create pull request | |
| uses: peter-evans/create-pull-request@v7 | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| title: 'genai-commentor: Suggested comment improvements' | |
| body: "Hi! 👋 I'm the Code Commentor 🤖.\n\nThis pull request was automatically generated by the genai-commentor action to write and update code comments.\n\n> ⚠️ AI can make mistakes — please review carefully before merging. ✅" | |
| branch: genai-commentor/updates | |
| commit-message: 'The Code Commentor: Suggested comment improvements' |