diff --git a/.github/workflows/2-step.yml b/.github/workflows/2-step.yml index 5a82d88..08175db 100644 --- a/.github/workflows/2-step.yml +++ b/.github/workflows/2-step.yml @@ -1,7 +1,7 @@ name: Step 2 on: - pull_request: + pull_request_target: branches: - main types: @@ -25,6 +25,7 @@ jobs: # This job is optional. We often call it a "grading job". If the step is not graded, remove it. check_step_work: name: Check step work + if: github.event.pull_request.merged == true runs-on: ubuntu-latest needs: [find_exercise] env: @@ -34,6 +35,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v5 + with: + ref: main - name: Get response templates uses: actions/checkout@v5 @@ -105,6 +108,7 @@ jobs: post_next_step_content: name: Post next step content + if: github.event.pull_request.merged == true needs: [find_exercise, check_step_work] runs-on: ubuntu-latest env: @@ -114,6 +118,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v5 + with: + ref: main - name: Get response templates uses: actions/checkout@v5 diff --git a/.github/workflows/3-last-step.yml b/.github/workflows/3-last-step.yml index 148145d..70847c3 100644 --- a/.github/workflows/3-last-step.yml +++ b/.github/workflows/3-last-step.yml @@ -1,7 +1,7 @@ name: Step 3 # Last step of the exercise on: - pull_request: + pull_request_target: branches: - main types: @@ -24,6 +24,7 @@ jobs: post_review_content: name: Post review content + if: github.event.pull_request.merged == true needs: [find_exercise] # if check_step_work then "needs: [find_exercise, check_step_work]" runs-on: ubuntu-latest env: @@ -33,6 +34,8 @@ jobs: steps: - name: Checkout uses: actions/checkout@v5 + with: + ref: main - name: Get response templates uses: actions/checkout@v5 @@ -62,6 +65,7 @@ jobs: finish_exercise: name: Finish Exercise + if: github.event.pull_request.merged == true needs: [find_exercise, post_review_content] uses: skills/exercise-toolkit/.github/workflows/finish-exercise.yml@v0.8.1 with: