mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-01-26 15:02:54 +02:00
URGENT: Fix course schedule watcher github action (#1867)
@djmitche Currently all PRs are marked as schedule change PRs. This is my try to propose a fix for this, but please review diligently, I'm no github actions expert, and I don't have an environment to test.
This commit is contained in:
parent
9a72b87fa9
commit
e74a8b77bd
14
.github/workflows/course-schedule-comment.yml
vendored
14
.github/workflows/course-schedule-comment.yml
vendored
@ -56,11 +56,11 @@ jobs:
|
||||
with:
|
||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||
script: |
|
||||
var fs = require('fs');
|
||||
var pr_number = Number(fs.readFileSync('pr-number'));
|
||||
var upstream = fs.readFileSync('upstream-schedule').toString();
|
||||
var schedule = fs.readFileSync('schedule').toString();
|
||||
schedule = "<!-- course-schedule -->\n" +
|
||||
const fs = require('fs');
|
||||
const pr_number = Number(fs.readFileSync('pr-number'));
|
||||
const upstream = fs.readFileSync('upstream-schedule').toString();
|
||||
const schedule = fs.readFileSync('schedule').toString();
|
||||
const new_schedule = "<!-- course-schedule -->\n" +
|
||||
"# Changes to Course Schedule\n" +
|
||||
"This PR changes the course schedule. The new schedule is shown below.\n\n" +
|
||||
schedule;
|
||||
@ -83,13 +83,13 @@ jobs:
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
comment_id: existing_comment.id,
|
||||
body: schedule,
|
||||
body: new_schedule,
|
||||
});
|
||||
} else if (upstream != schedule) {
|
||||
await github.rest.issues.createComment({
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
issue_number: pr_number,
|
||||
body: schedule,
|
||||
body: new_schedule,
|
||||
});
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user