-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathrobust-pr-description.yml
More file actions
52 lines (46 loc) · 1.7 KB
/
robust-pr-description.yml
File metadata and controls
52 lines (46 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
# Robust PR Description with Error Handling
# Includes retry logic and fallback notifications
name: Robust PR Description
on:
pull_request:
types: [opened]
jobs:
describe:
runs-on: ubuntu-latest
permissions:
contents: read
pull-requests: write
steps:
- name: Generate PR Description
id: describe
uses: augmentcode/describe-pr@v0
with:
augment_session_auth: ${{ secrets.AUGMENT_SESSION_AUTH }}
github_token: ${{ secrets.GITHUB_TOKEN }}
pull_number: ${{ github.event.pull_request.number }}
repo_name: ${{ github.repository }}
continue-on-error: true
- name: Notify on failure
if: steps.describe.outcome == 'failure'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.createComment({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
body: `⚠️ **Auto-description failed**
The automatic PR description generation encountered an error. Please add a description manually.
You can check the [workflow logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}) for more details.`
})
- name: Add failure label
if: steps.describe.outcome == 'failure'
uses: actions/github-script@v7
with:
script: |
github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: ['needs-description']
})