Skip to content

Commit

Permalink
set Checkout Pull Request step
Browse files Browse the repository at this point in the history
  • Loading branch information
tnyo43 committed Mar 2, 2024
1 parent 0db5dd3 commit 5d8974b
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions .github/workflows/test-action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,21 +9,24 @@ permissions:

jobs:
test-action:
name: GitHub Actions Test
name: GitHub Actions Testa
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: github.event.issue.pull_request
steps:
- name: Get PR branch
uses: xt0rted/pull-request-comment-branch@v1
id: comment-branch

- name: Checkout
id: checkout
uses: actions/checkout@v4
with:
ref: ${{ steps.comment-branch.outputs.head_ref }}

- name: Checkout Pull Request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
PR_URL="${{ github.event.issue.pull_request.url }}"
PR_NUM=${PR_URL##*/}
echo "Checking out from PR #$PR_NUM based on URL: $PR_URL"
hub pr checkout $PR_NUM
- name: Test Local Action
id: test-action
Expand Down

0 comments on commit 5d8974b

Please sign in to comment.