Thanks to visit codestin.com
Credit goes to github.com

Skip to content

gh workflow run --ref [ref] ignoring ref #9781

@qodfathr

Description

@qodfathr

Describe the bug

$ gh --version
gh version 2.59.0 (2024-10-16)
https://github.com/cli/cli/releases/tag/v2.59.0

Using the ref parameter does not seem to have any impact. A random-string ref gives no errors. A ref for an existing branch that has not yet been merged into the default branch reports 404 when trying to run a workflow that is new to that branch.

Steps to reproduce the behavior

  1. Create a new branch foo
  2. Create a new workflow file bar.yml with workflow_dispatch and no other triggers
  3. commit/push branch
  4. gh workflow run bar.yml --ref foo

Expected vs actual behavior

Expected: workflow bar.yml runs.
Actual: 404: Not found.

Logs

Paste the activity from your command line. Redact if needed.

$ GH_DEBUG=true gh workflow run bar.yml --ref foo
[git remote -v]
[git config --get-regexp ^remote\..*\.gh-resolved$]
* Request at 2024-10-17 10:33:53.601824859 -0400 EDT m=+0.076128339
* Request to https://api.github.com/graphql
* Request took 309.171144ms
* Request at 2024-10-17 10:33:53.914645102 -0400 EDT m=+0.388948592
* Request to https://api.github.com/repos/[ORG]/[REPO]/actions/workflows/bar.yml
* Request took 134.922376ms
HTTP 404: Not Found (https://api.github.com/repos/.../bar.yml)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-workflowrelating to the gh workflow commandhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions