Skip to content

Commit

Permalink
Ingestion checklist—managing PR with empty description (#3673)
Browse files Browse the repository at this point in the history
  • Loading branch information
yufei118liu authored Jul 23, 2024
1 parent 597802c commit e0fe9b1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/link-to-checklist.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,30 @@ jobs:
echo "Action: ${{ github.event.action }}"
echo "PR Title: ${{ github.event.pull_request.title }}"
echo "Starts with ingestion: ${{ startsWith(github.event.pull_request.title, 'ingestion') }}"
- name: Log from GitHub script
uses: actions/github-script@v6
with:
script: |
console.log('This is a test log.');
console.log('Event Name:', context.eventName);
console.log('Action:', context.payload.action);
console.log('PR Title:', context.payload.pull_request.title);
console.log('Starts with ingestion:', context.payload.pull_request.title.startsWith('ingestion'));
- name: Add review checklist
uses: actions/github-script@v6
with:
script: |
const fs = require('fs');
console.log('Reading checklist file...');
const review_checklist = fs.readFileSync('.github/ingestion-review-checklist.md', 'utf8');
const old_description = context.payload.pull_request.body || '';
console.log('Old description:', old_description);
const updated_body = !old_description.trim() ? review_checklist : old_description + "\n\n" + review_checklist;
github.rest.pulls.update({
pull_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: context.payload.pull_request.body + review_checklist,
});
pull_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: updated_body,
});
console.log('Updated body:', updated_body);
1 change: 1 addition & 0 deletions .github/workflows/print-info.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ jobs:
echo "Event Name: ${{ github.event_name }}"
echo "Action: ${{ github.event.action }}"
echo "PR Title: ${{ github.event.pull_request.title }}"
echo "Original PR Body: ${{ github.event.pull_request.body }}"

0 comments on commit e0fe9b1

Please sign in to comment.