Skip to content

Commit

Permalink
chore: fix bench yaml (#4962)
Browse files Browse the repository at this point in the history
  • Loading branch information
Timeless0911 committed Nov 17, 2023
1 parent d13149b commit 843e7ed
Showing 1 changed file with 8 additions and 21 deletions.
29 changes: 8 additions & 21 deletions .github/workflows/bench-pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -67,32 +67,19 @@ jobs:
}
- uses: actions/github-script@v6
id: trigger
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '!bench-framework')
with:
github-token: ${{ secrets.REPO_SCOPED_TOKEN }}
result-encoding: string
script: |
const prData = ${{ steps.get-pr-data.outputs.result }}
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
repo: 'web-infra-QoS',
workflow_id: 'pr-bench.yaml',
ref: 'master',
inputs: {
prNumber: '' + prData.num,
product: 'MODERNJS_FRAMEWORK',
repo: 'modern.js'
}
})
- uses: actions/github-script@v6
id: trigger
if: github.event.issue.pull_request && startsWith(github.event.comment.body, '!bench-module')
with:
github-token: ${{ secrets.REPO_SCOPED_TOKEN }}
result-encoding: string
script: |
const prData = ${{ steps.get-pr-data.outputs.result }}
let productName
if (startsWith(github.event.comment.body, '!bench-framework')) {
productName = 'MODERNJS_FRAMEWORK'
} else if (startsWith(github.event.comment.body, '!bench-module')) {
productName = 'MODERNJS_MODULE'
}
await github.rest.actions.createWorkflowDispatch({
owner: context.repo.owner,
Expand All @@ -101,7 +88,7 @@ jobs:
ref: 'master',
inputs: {
prNumber: '' + prData.num,
product: 'MODERNJS_MODULE',
product: productName,
repo: 'modern.js'
}
})

0 comments on commit 843e7ed

Please sign in to comment.