Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

URGENT: Fix course schedule watcher github action #1867

Merged
merged 1 commit into from
Mar 4, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions .github/workflows/course-schedule-comment.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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,
});
}