Simplify workflow_dispatch input handling and update checkout reference#44
Simplify workflow_dispatch input handling and update checkout reference#44suzukimain merged 1 commit intomasterfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR simplifies the workflow_dispatch input handling by removing the optional ref parameter and standardizing the behavior to always checkout and install from source when manually triggered. The workflow now uses github.ref instead of a custom input parameter for determining which branch/tag to test.
- Removed the
refinput parameter from workflow_dispatch configuration - Updated checkout logic to always execute for workflow_dispatch events using
github.refinstead of custom input - Modified installation logic to consistently install from source for all workflow_dispatch triggers
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| uses: actions/checkout@v4 | ||
| with: | ||
| ref: ${{ inputs.ref }} | ||
| ref: ${{ github.ref }} |
There was a problem hiding this comment.
Using github.ref in the checkout step may cause issues when the workflow is dispatched from the GitHub UI. For workflow_dispatch events, github.ref contains the full ref name (e.g., 'refs/heads/main'), which should work correctly with the checkout action. However, this removes the flexibility of testing different branches/tags that the previous inputs.ref parameter provided. Consider if this loss of flexibility aligns with your workflow requirements.
| if [ "${{ github.event_name }}" = "workflow_dispatch" ] && [ "${{ inputs.ref }}" != "" ]; then | ||
| echo "Installing auto_diffusers from source: ${{ inputs.ref }}" | ||
| if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then | ||
| echo "Installing auto_diffusers from source: ${{ github.ref }}" |
There was a problem hiding this comment.
The echo message displays the raw GitHub ref which will show the full reference path like 'refs/heads/main' or 'refs/tags/v1.0'. Consider using github.ref_name instead of github.ref here for clearer log output, as it provides just the branch or tag name without the 'refs/heads/' or 'refs/tags/' prefix.
| echo "Installing auto_diffusers from source: ${{ github.ref }}" | |
| echo "Installing auto_diffusers from source: ${{ github.ref_name }}" |
Refactor the workflow to streamline input handling for
workflow_dispatchand update the checkout reference to improve clarity and functionality. This change enhances the overall operation of the workflow.