diff --git a/.github/workflows/create_pr_suggestions.yml b/.github/workflows/create_pr_suggestions.yml index 8ec79a2..1696202 100644 --- a/.github/workflows/create_pr_suggestions.yml +++ b/.github/workflows/create_pr_suggestions.yml @@ -32,61 +32,13 @@ jobs: distribution: 'temurin' cache: 'maven' - # Capture the PR number - # https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#using-data-from-the-triggering-workflow - - name: Create pr_number.txt - run: echo "${{ github.event.number }}" > pr_number.txt - - uses: actions/upload-artifact@v4 - with: - name: pr_number - path: pr_number.txt - - name: Remove pr_number.txt - run: rm -f pr_number.txt - # Execute recipes - name: Apply OpenRewrite recipes run: mvn --activate-profiles apply-orbest-practices verify - # Capture the diff - - name: Create patch - run: | - git diff | tee git-diff.patch - - uses: actions/upload-artifact@v4 - with: - name: patch - path: git-diff.patch - - - uses: actions/checkout@v4 - with: - ref: ${{github.event.workflow_run.head_branch}} - repository: ${{github.event.workflow_run.head_repository.full_name}} - - # Download the patch - - uses: actions/download-artifact@v4 - with: - name: patch - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - - name: Apply patch - run: | - git apply git-diff.patch --allow-empty - rm git-diff.patch - - # Download the PR number - - uses: actions/download-artifact@v4 - with: - name: pr_number - github-token: ${{ secrets.GITHUB_TOKEN }} - run-id: ${{ github.event.workflow_run.id }} - - name: Read pr_number.txt - run: | - PR_NUMBER=$(cat pr_number.txt) - echo "PR_NUMBER=$PR_NUMBER" >> $GITHUB_ENV - rm pr_number.txt - # Post suggestions as a comment on the PR - uses: googleapis/code-suggester@v4 with: command: review - pull_number: ${{ env.PR_NUMBER }} + pull_number: ${{ github.event.number }} git_dir: '.'