This GitHub Action automatically tracks and uploads pull request code changes to Pie's platform. It captures PR metadata, changed files, and the full unified diff to enable Pie's autonomous bug-fix capabilities.
- Automatic extraction of PR information from GitHub context
- Full diff capture - Unified diff uploaded to cloud storage for LLM analysis
- File change metadata - Tracks which files changed with additions/deletions count
- Secure API key authentication
- Simple integration with existing GitHub workflows
- Built-in validation and error handling
- Works with merged PRs, opened PRs, and other PR events
Before using this action, you'll need:
- A Pie account - Sign up at https://app.pie.inc
- A Pie API key - After signing up, you can generate your API key for your app
To use this action in your GitHub workflow, add the following step to your .github/workflows/your-workflow.yml file:
- name: Track Code Changes in Pie
uses: pielabsai/codechanges-action@v1.0 # Replace with actual repository/version
with:
pie_api_key: ${{ secrets.PIE_API_KEY }}- name: Track Code Changes in Pie
uses: pielabsai/codechanges-action@v1.0
with:
pie_api_key: ${{ secrets.PIE_API_KEY }}
include_diff: "false"| Input | Description | Required | Default |
|---|---|---|---|
pie_api_key |
Your Pie API key for authentication. Should be stored as a GitHub secret. | Yes | - |
include_diff |
Include full unified diff in the upload | No | true |
The action automatically captures and sends the following information:
- Author: The GitHub username of the PR author
- Merge Commit: The SHA of the merge commit
- PR Number: The pull request number
- PR Title: The title of the pull request
- PR URL: The direct URL to the pull request
- Repository: The repository name in format
owner/repo - Base Branch: The target branch (e.g.,
main) - Head Branch: The source branch (e.g.,
feature/add-login) - Files: Array of changed files with metadata:
filename: Path to the filestatus: Change type (added, modified, removed, renamed)additions: Number of lines addeddeletions: Number of lines deleted
- Diff: Full unified diff (stored in cloud storage, path returned in response)
name: Track Code Changes
on:
pull_request:
types: [closed]
jobs:
track-changes:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Track Code Changes
uses: pielabsai/codechanges-action@v1.0
with:
pie_api_key: ${{ secrets.PIE_API_KEY }}name: Track Code Changes
on:
pull_request:
types: [opened, synchronize, reopened]
jobs:
track-changes:
runs-on: ubuntu-latest
steps:
- name: Track Code Changes
uses: pielabsai/codechanges-action@v1.0
with:
pie_api_key: ${{ secrets.PIE_API_KEY }}name: Track Code Changes
on:
pull_request:
types: [opened, synchronize, reopened, closed]
jobs:
track-changes:
runs-on: ubuntu-latest
steps:
- name: Track Code Changes
uses: pielabsai/codechanges-action@v1.0
with:
pie_api_key: ${{ secrets.PIE_API_KEY }}Best for tracking completed changes:
on:
pull_request:
types: [closed]
jobs:
track-changes:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latestTrack changes as soon as PRs are opened:
on:
pull_request:
types: [opened]Track every update to a PR:
on:
pull_request:
types: [opened, synchronize]Combine with other workflows:
on:
pull_request:
types: [opened, closed]
branches: [main, develop]
workflow_dispatch:The action includes built-in error handling for:
- Missing PR context
- API authentication failures
- Upload failures
- Network errors
Any errors will cause the action to fail with an appropriate error message in the workflow logs.
- Always store your Pie API key as a GitHub secret
- Never commit API keys directly in your workflow files
- The action automatically handles secure transmission of data
- All communications with the API use HTTPS
Make sure the action is triggered on a pull request event:
on:
pull_request:
types: [opened, closed]Verify that:
- Your
PIE_API_KEYsecret is set correctly in GitHub repository settings - The API key is valid and not expired
- Your account has permission to access the API
For issues, feature requests, or questions about this GitHub Action, please open an issue in the repository.
This GitHub Action is available under the MIT License. See the LICENSE file for more details.