Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
11 changes: 11 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,14 @@ 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
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'
});
39 changes: 29 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,40 @@ 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 --global user.name "github-actions[bot]"
git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com"
git add .
git commit -m "Apply ${{ inputs.tool }} fixes"
COMMIT_SHA=$(git rev-parse HEAD)
echo "commit_sha=$COMMIT_SHA" >> $GITHUB_OUTPUT
for i in {1..5}; do
if git push origin HEAD:${{ inputs.pr-info-ref }}; then
echo "Push successful on attempt $i."
echo "pushed=true" >> $GITHUB_OUTPUT
exit 0
fi
echo "Push failed on attempt $i. Waiting before retry..."
sleep $((5 * i))
echo "Fetching and rebasing..."
git fetch origin
if ! git rebase origin/${{ inputs.pr-info-ref }}; then
echo "::error::Automatic rebase failed. Please resolve conflicts manually."
exit 1
fi
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