mirror of
https://github.com/google/comprehensive-rust.git
synced 2025-05-15 15:16:51 +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:
|
with:
|
||||||
github-token: ${{ secrets.GITHUB_TOKEN }}
|
github-token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
script: |
|
script: |
|
||||||
var fs = require('fs');
|
const fs = require('fs');
|
||||||
var pr_number = Number(fs.readFileSync('pr-number'));
|
const pr_number = Number(fs.readFileSync('pr-number'));
|
||||||
var upstream = fs.readFileSync('upstream-schedule').toString();
|
const upstream = fs.readFileSync('upstream-schedule').toString();
|
||||||
var schedule = fs.readFileSync('schedule').toString();
|
const schedule = fs.readFileSync('schedule').toString();
|
||||||
schedule = "<!-- course-schedule -->\n" +
|
const new_schedule = "<!-- course-schedule -->\n" +
|
||||||
"# Changes to Course Schedule\n" +
|
"# Changes to Course Schedule\n" +
|
||||||
"This PR changes the course schedule. The new schedule is shown below.\n\n" +
|
"This PR changes the course schedule. The new schedule is shown below.\n\n" +
|
||||||
schedule;
|
schedule;
|
||||||
@ -83,13 +83,13 @@ jobs:
|
|||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
comment_id: existing_comment.id,
|
comment_id: existing_comment.id,
|
||||||
body: schedule,
|
body: new_schedule,
|
||||||
});
|
});
|
||||||
} else if (upstream != schedule) {
|
} else if (upstream != schedule) {
|
||||||
await github.rest.issues.createComment({
|
await github.rest.issues.createComment({
|
||||||
owner: context.repo.owner,
|
owner: context.repo.owner,
|
||||||
repo: context.repo.repo,
|
repo: context.repo.repo,
|
||||||
issue_number: pr_number,
|
issue_number: pr_number,
|
||||||
body: schedule,
|
body: new_schedule,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user