mirror of
https://github.com/TeamNewPipe/NewPipe.git
synced 2025-10-04 10:19:18 +02:00
Minimize images in PR descriptions
This commit is contained in:
parent
8cfba4003d
commit
d9e2ada369
2 changed files with 12 additions and 0 deletions
10
.github/workflows/image-minimizer.js
vendored
10
.github/workflows/image-minimizer.js
vendored
|
@ -17,6 +17,8 @@ module.exports = async ({github, context}) => {
|
|||
initialBody = context.payload.comment.body;
|
||||
} else if (context.eventName == 'issues') {
|
||||
initialBody = context.payload.issue.body;
|
||||
} else if (context.eventName == 'pull_request') {
|
||||
initialBody = context.payload.pull_request.body;
|
||||
} else {
|
||||
console.log('Aborting: No body found');
|
||||
return;
|
||||
|
@ -74,6 +76,14 @@ module.exports = async ({github, context}) => {
|
|||
repo: context.repo.repo,
|
||||
body: newBody
|
||||
});
|
||||
} else if (context.eventName == 'pull_request') {
|
||||
console.log('Updating pull request', context.payload.pull_request.number);
|
||||
await github.rest.pulls.update({
|
||||
pull_number: context.payload.pull_request.number,
|
||||
owner: context.repo.owner,
|
||||
repo: context.repo.repo,
|
||||
body: newBody
|
||||
});
|
||||
}
|
||||
|
||||
// Asnyc replace function from https://stackoverflow.com/a/48032528
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue