Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions .github/actions/get-pr-info/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,15 @@ runs:
core.setOutput('ref', pr.data.head.ref);
core.setOutput('sha', pr.data.head.sha);
core.setOutput('repo', pr.data.head.repo.full_name);
- name: React to comment
if: github.event_name == 'issue_comment'
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
continue-on-error: true
with:
script: |
github.rest.reactions.createForIssueComment({
owner: context.repo.owner,
repo: context.repo.repo,
comment_id: context.payload.comment.id,
content: 'eyes'
});
43 changes: 33 additions & 10 deletions .github/actions/handle-fix-commit/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -53,21 +53,44 @@ runs:
core.setOutput('maintainer_can_modify', pr.maintainer_can_modify);
- name: Commit fixes
if: steps.check_changes.outputs.changes == 'true' && (inputs.pr-info-repo == github.repository || steps.pr-properties.outputs.maintainer_can_modify == 'true')
uses: EndBug/add-and-commit@a94899bca583c204427a224a7af87c02f9b325d5 # v9.1.4
id: add_and_commit
with:
token: ${{ inputs.token }}
cwd: ${{ inputs.working-directory }}
author_name: "github-actions[bot]"
author_email: "41898282+github-actions[bot]@users.noreply.github.com"
message: "Apply ${{ inputs.tool }} fixes"
id: commit_and_push
shell: bash
working-directory: ${{ inputs.working-directory }}
run: |
git config --local user.name "github-actions[bot]"
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com"
git remote set-url origin "https://x-access-token:${{ inputs.token }}@github.com/${{ github.repository }}"
git add .
git commit -m "Apply ${{ inputs.tool }} fixes"
for i in {1..6}; do
if git push origin HEAD:${{ inputs.pr-info-ref }}; then
echo "Push successful on attempt $i."
COMMIT_SHA=$(git rev-parse HEAD)
echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
echo "pushed=true" >> $GITHUB_OUTPUT
exit 0
fi
if [ $i -eq 6 ]; then
break
fi
echo "Push failed on attempt $i. Fetching and rebasing before retry..."
git fetch origin
if ! git rebase origin/${{ inputs.pr-info-ref }}; then
echo "::error::Automatic rebase failed. Please resolve conflicts manually."
exit 1
fi
echo "Waiting before retry..."
sleep $((5 * i))
done
echo "::error::Failed to push changes after multiple retries."
exit 1

- name: Notify of commit
if: steps.add_and_commit.conclusion == 'success' && steps.add_and_commit.outputs.committed == 'true' && steps.add_and_commit.outputs.pushed == 'true'
if: steps.commit_and_push.conclusion == 'success' && steps.commit_and_push.outputs.pushed == 'true'
uses: thollander/actions-comment-pull-request@24bffb9b452ba05a4f3f77933840a6a841d1b32b # v3.0.1
with:
message: |
Automatic ${{ inputs.tool }} fixes pushed (commit ${{ steps.add_and_commit.outputs.commit_sha }}).
Automatic ${{ inputs.tool }} fixes pushed (commit ${{ steps.commit_and_push.outputs.commit_sha }}).
⚠️ **Note:** Some issues may require manual review and fixing.

- name: Create patch
Expand Down
Loading