Skip to content

Commit

Permalink
execute all steps in one job
Browse files Browse the repository at this point in the history
  • Loading branch information
MBoegers committed Mar 14, 2024
1 parent 849baae commit a963ec3
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 57 deletions.
56 changes: 0 additions & 56 deletions .github/workflows/comment_pr.yml

This file was deleted.

40 changes: 39 additions & 1 deletion .github/workflows/create_pr_suggestions.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@ concurrency:
cancel-in-progress: true

jobs:
upload-patch:
create-suggestions:
runs-on: ubuntu-latest
env:
# https://docs.github.com/en/actions/reference/authentication-in-a-workflow#permissions-for-the-github_token
ACCESS_TOKEN: ${{ secrets.GITHUB_TOKEN }}
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
Expand Down Expand Up @@ -52,3 +55,38 @@ jobs:
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 }}
git_dir: '.'

0 comments on commit a963ec3

Please sign in to comment.