git-ai #109
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
| # Example workflow - Copy this to your repository's .github/workflows/ directory | |
| # Rename to git-ai.yml or similar | |
| # | |
| # Version Pinning (recommended for security): | |
| # Action version: use @v1.0.0 (see https://github.com/git-ai-project/action/releases) | |
| # git-ai version: use git-ai-version input (see https://github.com/acunniffe/git-ai/releases) | |
| name: git-ai | |
| on: | |
| pull_request: | |
| types: [closed] | |
| schedule: | |
| - cron: "0 0 * * *" # Daily at midnight UTC | |
| workflow_dispatch: | |
| jobs: | |
| pr-close: | |
| if: github.event.pull_request.merged == true | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Run Git AI PR Close | |
| # You want @v1 | |
| # uses: git-ai-project/action/pr-close@v1 | |
| uses: git-ai-project/action/pr-close@main | |
| continue-on-error: true | |
| with: | |
| pr-url: ${{ github.event.pull_request.html_url }} | |
| merge-commit-sha: ${{ github.event.pull_request.merge_commit_sha }} | |
| # Uncomment and configure for OTLP export: | |
| # OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTLP_ENDPOINT }} | |
| # OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer ${{ secrets.OTLP_TOKEN }}" | |
| # OTEL_SERVICE_NAME: my-service | |
| daily-metrics: | |
| if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch' | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| steps: | |
| - name: Run Git AI Daily Metrics | |
| # You want @v1 | |
| # uses: git-ai-project/action/daily-metrics@v1 | |
| uses: git-ai-project/action/daily-metrics@main | |
| with: | |
| # git-ai-version: "v1.0.23" # Pin to a specific version for reproducibility | |
| default-branch: ${{ github.event.repository.default_branch }} | |
| # Uncomment and configure for OTLP export: | |
| # OTEL_EXPORTER_OTLP_ENDPOINT: ${{ secrets.OTLP_ENDPOINT }} | |
| # OTEL_EXPORTER_OTLP_HEADERS: "Authorization=Bearer ${{ secrets.OTLP_TOKEN }}" | |
| # OTEL_SERVICE_NAME: my-service |