Skip to content

Commit

Permalink
feat(ci): extend /test command functionality for PR testing (#17154)
Browse files Browse the repository at this point in the history
* feat(ci): extend `/test` command functionality for PR testing

* fix: optimize PR testing workflow

---------
  • Loading branch information
NekoAria authored Oct 23, 2024
1 parent 9f7bcc2 commit 8aeb577
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions .github/workflows/issue-command.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,31 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 5
permissions:
issues: write
attestations: write
issues: write
pull-requests: write
steps:
- name: Fetch PR data (for PR)
if: github.event.issue.pull_request
uses: octokit/[email protected]
id: pr-data
with:
route: GET /repos/{repo}/pulls/{number}
repo: ${{ github.repository }}
number: ${{ github.event.issue.number }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Checkout
if: ${{ !github.event.issue.pull_request }}
uses: actions/checkout@v4

- name: Checkout PR
if: github.event.issue.pull_request
uses: actions/checkout@v4
with:
ref: ${{ fromJson(steps.pr-data.outputs.data).head.ref }}

- name: Install pnpm
uses: pnpm/action-setup@v4

Expand Down Expand Up @@ -105,7 +124,7 @@ jobs:
await test({ github, context, core }, link, routes, number)
- name: Print logs
if: (env.TEST_CONTINUE)
if: env.TEST_CONTINUE
run: cat ${{ github.workspace }}/logs/combined.log

- name: Upload Artifact
Expand Down

0 comments on commit 8aeb577

Please sign in to comment.