CI Workflows
Automate authorship tracking in your CI/CD pipeline with git-ai's continuous integration workflows
CI Workflows
The GitHub, GitLab and BitBucket GUIs have "Squash and Merge" and "Rebase and Merge". Since the SCM tools aren't running Git AI on their servers, authorship information is not preserved through these operations the way it would be locally.
Git AI has a Cloud + Self-Hosted SCM App that will automatically rewrite authorship information when PRs to any repository are merged. It is under development and will be available soon, if you want to get early access schedule a call.
Alternatively there are CI Scripts in the Open Source repository that can run in your CI/CD pipeline to update the Authorship Logs after a PR is "Squash|Rebase and Merged". You will have to set them up in the CI pipeline for each repository you want to track authorship in.
GitHub Actions
The GitHub Actions workflow automatically runs when pull requests are merged, detecting squash and rebase merges and rewriting authorship accordingly.
Installation
Install the GitHub Actions workflow in your repository:
git-ai ci github installThis creates .github/workflows/git-ai.yaml in your repository with the following configuration:
- Trigger: Runs on pull request close events
- Permissions: Requires
contents: writeto push authorship notes - Actions:
- Installs git-ai from the official install script
- Configures git user as
github-actions[bot] - Runs
git-ai ci github runto process the merge
name: Git AI
on:
pull_request:
types: [closed]
jobs:
git-ai:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Install git-ai
run: |
curl -fsSL https://usegitai.com/install.sh | bash
echo "$HOME/.git-ai/bin" >> $GITHUB_PATH
- name: Run git-ai
id: run-git-ai
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
git-ai ci github runGitLab CI
The GitLab CI job automatically runs when commits are pushed to your default branch, detecting squash and rebase merges and rewriting authorship accordingly.
Setup
Run the following command to generate the YAML snippet top copy into your .gitlab-ci.yml file.
git-ai ci gitlab installAdd the following job to your .gitlab-ci.yml file.
The default CI_JOB_TOKEN often lacks API query permissions. You'll need to create a dedicated access token.
Create an access token:
-
Go to Settings → Access tokens → Add new token
- Name:
git-ai - Role:
Maintainer - Scopes:
api,write_repository(both required)
- Name:
-
Go to Settings → CI/CD → Variables → Add variable
- Key:
GITLAB_TOKEN - Value: paste your token
- Check Masked
- Key:
Configuration:
- Trigger: Runs on push events to the default branch
- Permissions: Requires
apiandwrite_repositoryscopes - Actions:
- Installs git-ai from the official install script
- Configures git user as
gitlab-ci[bot] - Runs
git-ai ci gitlab runto process the merge
git-ai:
stage: build
rules:
- if: $CI_COMMIT_BRANCH == $CI_DEFAULT_BRANCH && $CI_PIPELINE_SOURCE == "push"
when: always
script:
- curl -fsSL https://usegitai.com/install.sh | bash
- export PATH="$HOME/.git-ai/bin:$PATH"
- git config --global user.name "gitlab-ci[bot]"
- git config --global user.email "gitlab-ci[bot]@users.noreply.gitlab.com"
- git-ai ci gitlab runBitBucket Pipelines
Not currently supported. PRs welcome on GitHub.
Azure Repos
Not currently supported. PRs welcome on GitHub.
MDM Deployment
Deploy Git AI extension across your organization using MDM or custom install scripts. Recommended enterprise deployment method for tracking AI code at scale.
Performance FAQs
Git AI's performance characteristics and impact on git operations. Learn about overhead, scaling, and benchmarks for enterprise deployments.