Skip to content
Merged
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
17 changes: 14 additions & 3 deletions .github/workflows/auto-update-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,22 @@ jobs:
git config user.name otelbot
git config user.email [email protected]

- id: gradle-task
if: steps.unzip-patch.outputs.exists == 'true'
run: |
if [[ "${{ github.event.workflow_run.name }}" == "Auto spotless" ]]; then
echo "name=spotlessApply" >> $GITHUB_OUTPUT
elif [[ "${{ github.event.workflow_run.name }}" == "Auto license report" ]]; then
echo "name=generateLicenseReport" >> $GITHUB_OUTPUT
else
echo "name=unknown" >> $GITHUB_OUTPUT
fi

- name: Apply patch and push
if: steps.unzip-patch.outputs.exists == 'true'
run: |
git apply "${{ runner.temp }}/patch"
git commit -a -m "./gradlew spotlessApply"
git commit -a -m "./gradlew ${{ steps.gradle-task.outputs.name }}"
git push

- id: get-pr
Expand All @@ -84,12 +95,12 @@ jobs:
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
PR_NUMBER: ${{ steps.get-pr.outputs.number }}
run: |
gh pr comment $PR_NUMBER --body "🔧 The result from spotlessApply was committed to the PR branch."
gh pr comment $PR_NUMBER --body "🔧 The result from ${{ steps.gradle-task.outputs.name }} was committed to the PR branch."

- if: steps.unzip-patch.outputs.exists == 'true' && failure()
env:
GH_REPO: ${{ github.repository }}
GH_TOKEN: ${{ steps.otelbot-token.outputs.token }}
PR_NUMBER: ${{ steps.get-pr.outputs.number }}
run: |
gh pr comment $PR_NUMBER --body "❌ The result from spotlessApply could not be committed to the PR branch, see logs: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID."
gh pr comment $PR_NUMBER --body "❌ The result from ${{ steps.gradle-task.outputs.name }} could not be committed to the PR branch, see logs: $GITHUB_SERVER_URL/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID."
Loading