@@ -34,66 +34,11 @@ jobs:
34
34
core.setOutput("shouldMerge", "false");
35
35
return;
36
36
}
37
-
38
- // Retrieve the combined status for the PR's latest commit.
39
- const { data: combinedStatus } = await github.rest.repos.getCombinedStatusForRef({
40
- owner: context.repo.owner,
41
- repo: context.repo.repo,
42
- ref: pr.head.sha
43
- });
44
- core.info(`Combined status state: ${combinedStatus.state}`);
45
-
46
- // Only merge if all status checks have passed.
47
- if (combinedStatus.state !== 'success') {
48
- core.info("Not all status checks have passed. Skipping auto-merge.");
49
- core.setOutput("shouldMerge", "false");
50
- return;
51
- }
52
-
53
- core.info("All conditions met. PR is eligible for auto-merge.");
54
- core.setOutput("shouldMerge", "true");
55
- result-encoding : string
56
-
57
- - name : Wait for checks to pass
58
- if : steps.check.outputs.shouldMerge == 'true'
59
- uses : actions/github-script@v6
60
- with :
61
- script : |
62
- const prNumber = context.payload.pull_request.number;
63
- const { data: pr } = await github.rest.pulls.get({
64
- owner: context.repo.owner,
65
- repo: context.repo.repo,
66
- pull_number: prNumber
67
- });
68
-
69
- // Wait for status checks to pass.
70
- let checksPending = true;
71
- let retries = 0;
72
- const maxRetries = 20;
73
- const waitTime = 30000;
74
-
75
- while (checksPending && retries < maxRetries) {
76
- const { data: combinedStatus } = await github.rest.repos.getCombinedStatusForRef({
77
- owner: context.repo.owner,
78
- repo: context.repo.repo,
79
- ref: pr.head.sha
80
- });
81
-
82
- if (combinedStatus.state === 'success') {
83
- checksPending = false;
84
- } else {
85
- core.info(`Checks still pending. Waiting... (${retries + 1}/${maxRetries})`);
86
- await new Promise(resolve => setTimeout(resolve, waitTime));
87
- retries++;
88
- }
89
- }
90
37
91
- if (checksPending) {
92
- throw new Error("Checks did not complete successfully within the time limit .");
93
- }
38
+ // Skip combined status check and proceed to auto-merge.
39
+ core.info("Skipping status checks. Proceeding with auto-merge .");
40
+ core.setOutput("shouldMerge", "true");
94
41
95
- core.info("All checks passed.");
96
-
97
42
- name : Auto-Merge PR
98
43
if : steps.check.outputs.shouldMerge == 'true'
99
44
uses : actions/github-script@v6
0 commit comments