mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-09-06 09:56:09 +00:00
Translation-related actions fixes
This commit is contained in:
28
.github/workflows/scripts/close_and_reopen_pr.js
vendored
Normal file
28
.github/workflows/scripts/close_and_reopen_pr.js
vendored
Normal file
@ -0,0 +1,28 @@
|
||||
module.exports = (async function ({github, context}) {
|
||||
const pr_number = process.env.PR_NUMBER;
|
||||
const pr_operation = process.env.PR_OPERATION;
|
||||
|
||||
if (!['created', 'updated'].includes(pr_operation)) {
|
||||
console.log('PR was not created as there were no changes.')
|
||||
return;
|
||||
}
|
||||
|
||||
// Close the PR
|
||||
github.issues.update({
|
||||
issue_number: pr_number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'closed'
|
||||
});
|
||||
|
||||
// Wait a moment for GitHub to process it...
|
||||
await new Promise(r => setTimeout(r, 2000));
|
||||
|
||||
// Then reopen the PR so it runs CI
|
||||
github.issues.update({
|
||||
issue_number: pr_number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
state: 'open'
|
||||
});
|
||||
})
|
Reference in New Issue
Block a user