Skip to content

ci: Update unity-test.yml#35

Merged
kochounoyume merged 1 commit intomainfrom
feature/fix-ci-unitytest2
Jul 30, 2025
Merged

ci: Update unity-test.yml#35
kochounoyume merged 1 commit intomainfrom
feature/fix-ci-unitytest2

Conversation

@kochounoyume
Copy link
Member

This pull request updates the CI workflow configuration in .github/workflows/unity-test.yml to enhance its flexibility and reliability by supporting additional GitHub event types and improving the handling of references.

Workflow configuration updates:

  • Modified the if condition for the test job to support additional GitHub event types (pull_request_target, push, and workflow_dispatch) while maintaining the existing condition for the request-ci label.
  • Updated the ref parameter in the actions/checkout step to use a fallback to github.sha if github.event.pull_request.head.sha is not available.

@kochounoyume kochounoyume requested a review from Copilot July 30, 2025 13:09
@kochounoyume kochounoyume self-assigned this Jul 30, 2025
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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, and workflow_dispatch events
  • Added fallback logic for the checkout reference to use github.sha when github.event.pull_request.head.sha is 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' }}
Copy link

Copilot AI Jul 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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'

Suggested change
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' }}

Copilot uses AI. Check for mistakes.
@kochounoyume kochounoyume merged commit 6a54ae2 into main Jul 30, 2025
4 checks passed
@kochounoyume kochounoyume deleted the feature/fix-ci-unitytest2 branch July 30, 2025 13:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants