Test workflow#443
Conversation
There was a problem hiding this comment.
The GitHub workflow has a logical flaw in its triggers. It's configured to run on pull requests, but it relies on an input that is only available during manual workflow_dispatch triggers, which will cause it to fail when run automatically on a pull request. Additionally, the branch name for the pull request trigger may be outdated.
| required: true | ||
| type: string | ||
| pull_request: | ||
| branches: [ master ] |
There was a problem hiding this comment.
The pull request trigger is configured for the master branch. This should be changed to main if that is the repository's default branch.
| pull_request: | ||
| branches: [ master ] | ||
|
|
||
| jobs: | ||
| run-test: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
|
|
||
| - name: Setup Node.js | ||
| uses: actions/setup-node@v4 | ||
| with: | ||
| node-version: 22.x | ||
| cache: 'yarn' | ||
|
|
||
| - name: Install dependencies | ||
| run: yarn --immutable | ||
|
|
||
| - name: Run test | ||
| run: yarn test ${{ github.event.inputs.test_name }} |
There was a problem hiding this comment.
The workflow is set up to be triggered by pull_request, but the run test step on line 32 depends on github.event.inputs.test_name, which is only populated during a workflow_dispatch event. When triggered by a pull request, this input will be empty, causing the test command to fail or run incorrectly. The pull_request trigger should be removed, as this workflow is designed to be run manually.
No description provided.