@@ -67,16 +67,16 @@ runs:
6767 with :
6868 github-token : ${{ inputs.github-token }}
6969 script : |
70- let attemps = 0;
71- const maxAttemps = 10;
70+ let attempts = 0;
71+ const maxAttempts = 10;
7272
7373 const pullNumberRaw = process.env.PULL_REQUEST_NUMBER ?? '';
7474 if (!/^[0-9]+$/.test(pullNumberRaw)) {
7575 throw new Error(`Invalid pull request number: ${pullNumberRaw}`);
7676 }
7777 const pullNumber = Number.parseInt(pullNumberRaw, 10);
7878
79- while (attemps < maxAttemps ) {
79+ while (attempts < maxAttempts ) {
8080 const { data: { mergeable, mergeable_state } } = await github.rest.pulls.get({
8181 owner: context.repo.owner,
8282 repo: context.repo.repo,
9191 core.debug(`Pull request is not mergeable, mergeable_state: ${mergeable_state}`);
9292
9393 await new Promise(resolve => setTimeout(resolve, 5000));
94- attemps ++;
94+ attempts ++;
9595 }
9696
9797 core.error('Pull request is not mergeable');
@@ -110,11 +110,11 @@ runs:
110110 exit 1
111111 fi
112112
113- ATTEMPS =0
114- MAX_ATTEMPS =10
113+ ATTEMPTS =0
114+ MAX_ATTEMPTS =10
115115 REQUIRED_WORKFLOWS_ERROR="Required workflow"
116116
117- while [ $ATTEMPS -lt $MAX_ATTEMPS ]; do
117+ while [ $ATTEMPTS -lt $MAX_ATTEMPTS ]; do
118118 echo "::debug::Merging pull request #${PULL_REQUEST_NUMBER} for repository ${{ github.repository }}..."
119119 MERGE_OUTPUTS=$(gh pr merge -R "${{ github.repository }}" --rebase --admin "${PULL_REQUEST_NUMBER}" 2>&1)
120120 MERGE_EXIT_CODE=$?
@@ -132,8 +132,8 @@ runs:
132132
133133 echo "::debug::Pull request is not mergeable yet because some of required workflow check issues, retrying in 5 seconds..."
134134 sleep 5
135- ATTEMPS =$((ATTEMPS +1))
135+ ATTEMPTS =$((ATTEMPTS +1))
136136 done
137137
138- echo "::error::Failed to merge pull request after $MAX_ATTEMPS attemps : $MERGE_OUTPUTS"
138+ echo "::error::Failed to merge pull request after $MAX_ATTEMPTS attempts : $MERGE_OUTPUTS"
139139 exit 1
0 commit comments