Skip to content

Commit d4724a9

Browse files
committed
Improvements
1 parent 492d164 commit d4724a9

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

index.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,19 +17,32 @@ const main = async () => {
1717
if (!context.actor.match(allowed_usernames)) {
1818
core.warning('Ignored, the username does not match.');
1919
return;
20+
} else {
21+
core.info('Username matched.');
2022
}
23+
2124
const pullRequest = await octokit.pulls.get({
2225
...context.repo,
2326
...context.owner,
2427
pull_number: number
2528
});
2629

30+
if (pullRequest.data.state === 'closed') {
31+
core.warning('Ignored, the pull-request is closed.');
32+
return;
33+
} else {
34+
core.info('The pull-request is open.');
35+
}
36+
2737
if (pullRequest.data.labels.indexOf(filter_label) !== -1) {
2838
core.warning('Ignored, the label does not exist on the pull-request.');
2939
return;
40+
} else {
41+
core.info('Label matched.');
3042
}
3143

3244
if (merge_method === 'fast-forward') {
45+
core.info('Updating to: ' + pullRequest.data.base.ref + '@' + pullRequest.data.head.sha);
3346
await octokit.git.updateRef({
3447
force: false,
3548
...context.repo,

0 commit comments

Comments
 (0)