Skip to content

Add testing to describe action #1

Add testing to describe action

Add testing to describe action #1

# On-Demand PR Description
# Generates descriptions when the "augment_describe" label is added to a PR
name: On-Demand PR Description
on:
pull_request:
types: [labeled]
jobs:
describe:
# Only run when the specific label is added
if: github.event.label.name == 'augment_describe'
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Checkout
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- name: Generate PR Description
uses: ./
with:
augment_session_auth: ${{ secrets.AUGMENT_SESSION_AUTH }}
github_token: ${{ secrets.GITHUB_TOKEN }}
pull_number: ${{ github.event.pull_request.number }}
repo_name: ${{ github.repository }}
custom_guidelines: |
- Always reference Jira ticket numbers in brackets format (example: [ENG-123] or [PLAT-11169])
- Always reference Jira ticket of the PR in the PR description near the top of PR
- Highlight any database migrations included in the changes
- Highlight any backfills included in the changes
- name: Remove trigger label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
// Remove the trigger label after processing
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name: 'augment_describe'
});
- name: Add completion label
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7
with:
script: |
// Add a label to indicate the description was generated
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['auto-described']
});