Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Regression in latest 1.2.1 version #50

Closed
alambike opened this issue Nov 3, 2022 · 11 comments
Closed

Regression in latest 1.2.1 version #50

alambike opened this issue Nov 3, 2022 · 11 comments

Comments

@alambike
Copy link

alambike commented Nov 3, 2022

Bug description

We see strange behavior in our workflows, after upgrading to the latest 1.2.1 version.

After this change, now if the passed ref is an empty string, the action is not calculating the ref and the step fails.

Example:

      - name: Dispatch my-workflow with workflow_dispatch
        if: github.event_name == 'workflow_dispatch' || github.event.pull_request.merged == true
        uses: benc-uk/workflow-dispatch@b8ac4001bdf17685419a1b65af6fa92fc9a3de0e
        with:
          workflow: my-workflow
          ref: ${{ github.head_ref }}

In the case when a workflow_dispatch event triggers this workflow, the github.head_ref is empty, but now the action doesn't calculate the github.ref, as a ref input is passed, so the ref ends up as an empty string and the workflow execution fails with:

Error: No ref found for:
@benc-uk
Copy link
Owner

benc-uk commented Nov 4, 2022

Hmmm interesting, maybe a good reason it was the way it was before!
I'll release a fix

@benc-uk
Copy link
Owner

benc-uk commented Nov 4, 2022

Should be fixed in master, v1, v1.2 and v1.2.2
Let me know if its not

@dpelengic
Copy link

Observing this issue in v1, after the update.

@dfar-io
Copy link

dfar-io commented Nov 4, 2022

Still seeing the issue in both v1 and v1.2.2, going to try adding ref and see if that works as a fix:

image

Definition:

- name: Trigger Deployment
        uses: benc-uk/workflow-dispatch@v1
        with:
          workflow: Deploy
          token: ${{ secrets.GIT_TOKEN }}
          inputs: '{ "message": "${{ env.COMMIT_MESSAGE }}" }'

@bjoernw
Copy link

bjoernw commented Nov 4, 2022

Still breaking even at benc-uk/workflow-dispatch@a69ac85ea87587e76bb4f262eb868205dfcab8e8

@dfar-io
Copy link

dfar-io commented Nov 4, 2022

A workaround for the time being, adding ref:

- name: Trigger Deployment
        uses: benc-uk/workflow-dispatch@v1.2.2
        with:
          workflow: YOUR_WORKFLOW
          ref: ${{ github.event.ref }}
          inputs: ANY_INPUTS_YOU_MIGHT_HAVE

@bjoernw
Copy link

bjoernw commented Nov 4, 2022

Can confirm, workaround works. Going to leave this pinned to a git sha ;)

uses: benc-uk/workflow-dispatch@a69ac85ea87587e76bb4f262eb868205dfcab8e8
with:
   workflow: my-workflow
   ref: ${{ github.event.ref }}

@whanata
Copy link

whanata commented Nov 5, 2022

A workaround for the time being, adding ref:

- name: Trigger Deployment
        uses: benc-uk/workflow-dispatch@v1.2.2
        with:
          workflow: YOUR_WORKFLOW
          ref: ${{ github.event.ref }}
          inputs: ANY_INPUTS_YOU_MIGHT_HAVE

It doesn't work if I use a schedule though, I still get the same error.

@benc-uk
Copy link
Owner

benc-uk commented Nov 5, 2022

Realize there was a release tagging issue
Can people try again with v1 or v1.2 or v1.2.2 tags?

@whanata
Copy link

whanata commented Nov 5, 2022

Cheers, it looks like it's working for me now, thanks.

@benc-uk
Copy link
Owner

benc-uk commented Nov 7, 2022

Closing for now as it seems to be fixed

@benc-uk benc-uk closed this as completed Nov 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants