Conversation
There was a problem hiding this comment.
Pull Request Overview
This PR updates the CI workflow configuration to support multiple GitHub event types and improve reference handling. The changes enhance the workflow's flexibility by allowing it to run on different triggers while maintaining existing label-based conditions.
- Modified the job condition to support
pull_request_target,push, andworkflow_dispatchevents - Added fallback logic for the checkout reference to use
github.shawhengithub.event.pull_request.head.shais unavailable
| test: | ||
| runs-on: ubuntu-latest | ||
| if: github.event.label.name == 'request-ci' | ||
| if: ${{ github.event_name == 'pull_request_target' && github.event.label.name == 'request-ci' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} |
There was a problem hiding this comment.
The condition logic is incorrect. For push and workflow_dispatch events, github.event.label.name will not exist, but the current condition requires the label check for pull_request_target events to be true OR the other events to be true. This means push and workflow_dispatch will always trigger the job regardless of the label condition. The condition should be: (github.event_name == 'pull_request_target' && github.event.label.name == 'request-ci') || github.event_name == 'push' || github.event_name == 'workflow_dispatch'
| if: ${{ github.event_name == 'pull_request_target' && github.event.label.name == 'request-ci' || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} | |
| if: ${{ (github.event_name == 'pull_request_target' && github.event.label.name == 'request-ci') || github.event_name == 'push' || github.event_name == 'workflow_dispatch' }} |
This pull request updates the CI workflow configuration in
.github/workflows/unity-test.ymlto enhance its flexibility and reliability by supporting additional GitHub event types and improving the handling of references.Workflow configuration updates:
ifcondition for thetestjob to support additional GitHub event types (pull_request_target,push, andworkflow_dispatch) while maintaining the existing condition for therequest-cilabel.refparameter in theactions/checkoutstep to use a fallback togithub.shaifgithub.event.pull_request.head.shais not available.