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

[BUG]: failed to register input as workflow or action #462

Closed
2 tasks done
cipherboy opened this issue Jan 18, 2025 · 4 comments · Fixed by #463
Closed
2 tasks done

[BUG]: failed to register input as workflow or action #462

cipherboy opened this issue Jan 18, 2025 · 4 comments · Fixed by #463
Labels
bug Something isn't working

Comments

@cipherboy
Copy link

cipherboy commented Jan 18, 2025

Pre-submission checks

  • I am not filing a feature request. These should be filed via the feature request form instead.
  • I have looked through the open issues for a duplicate report.

Expected behavior

This looks like a duplicate of #431 but neither v1.0.1 nor v1.1.1 (patched) seem able to parse it:

Actual behavior

Old version:

$ zizmor --verbose .github/workflows/test-go.yml 
2025-01-18T13:32:17.920831Z DEBUG zizmor::state: using cache directory: "/home/cipherboy/.cache/zizmor"
failed to register input: .github/workflows/test-go.yml

Caused by:
    0: invalid GitHub Actions definition: file:///home/cipherboy/GitHub/cipherboy/openbao/.github/workflows/test-go.yml
    1: invalid GitHub Actions workflow: file:///home/cipherboy/GitHub/cipherboy/openbao/.github/workflows/test-go.yml
    2: failed to register input as workflow or action
$ /home/cipherboy/.local/bin/zizmor --version
zizmor 1.0.1

Perform update:

$ python3.13 -m pip install -v "zizmor==1.1.1"
Using pip 24.2 from /usr/lib/python3.13/site-packages/pip (python 3.13)
Defaulting to user installation because normal site-packages is not writeable
Collecting zizmor==1.1.1
  Obtaining dependency information for zizmor==1.1.1 from https://files.pythonhosted.org/packages/3a/e2/73fd210a5c3b8ccb0defdda959bbbc0c6f1f061107ae9326675d4aa8eed7/zizmor-1.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata
  Using cached zizmor-1.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (2.5 kB)
Using cached zizmor-1.1.1-py3-none-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (4.7 MB)
Installing collected packages: zizmor
  Attempting uninstall: zizmor
    Found existing installation: zizmor 1.0.1
    Uninstalling zizmor-1.0.1:
      Removing file or directory /home/cipherboy/.local/bin/zizmor
      Removing file or directory /home/cipherboy/.local/lib/python3.13/site-packages/zizmor-1.0.1.dist-info/
      Successfully uninstalled zizmor-1.0.1
Successfully installed zizmor-1.1.1
$ zizmor --version
zizmor 1.1.1

Rerun:

$ zizmor --verbose .github/workflows/test-go.yml 
2025-01-18T13:40:09.036229Z DEBUG zizmor::state: using cache directory: "/home/cipherboy/.cache/zizmor"
failed to register input: .github/workflows/test-go.yml

Caused by:
    0: invalid GitHub Actions definition: file:///home/cipherboy/GitHub/cipherboy/openbao/.github/workflows/test-go.yml
    1: invalid GitHub Actions workflow: file:///home/cipherboy/GitHub/cipherboy/openbao/.github/workflows/test-go.yml
    2: failed to register input as workflow or action

on this workflow: https://github.com/openbao/openbao/blob/8d3b68efd6b90adbde3ca76acf530a125061b98b/.github/workflows/test-go.yml

Reproduction steps

  1. Clone OpenBao: https://github.com/openbao/openbao
  2. Run zizmor --verbose .github/workflows/test-go.yml
  3. See failure

Logs

(Above)

Additional context

Removing all "uses:" entries doesn't seem to help, so I suspect the problem is unrelated? Based on the context I understand from woodruffw/github-actions-models#30, it seems like perhaps a parse error isn't being surfaced correctly? Though this action runs in CI just fine (e.g., https://github.com/openbao/openbao/actions/runs/12837585390).

Saw this in the FOSDEM speakers chat, good luck and hope to see you there! Thank you as always! :-)

@cipherboy cipherboy added bug Something isn't working triage Issue is being triaged labels Jan 18, 2025
@woodruffw
Copy link
Owner

Hi @cipherboy, thanks for the report! I'm taking a look now.

@woodruffw
Copy link
Owner

Thanks a ton for providing a repro case here!

I was able to minimize this, and it's a different bug than #431: the bug here is that the models assume that timeout-minutes: is always a number, but it can also be an expression expansion. OpenBao has one such expansion here:

https://github.com/openbao/openbao/blob/8d3b68efd6b90adbde3ca76acf530a125061b98b/.github/workflows/test-go.yml#L170

This should be a pretty simple fix on my end!

@cipherboy
Copy link
Author

Oh wow, that was fast @woodruffw! Thank you so much!!

woodruffw added a commit to woodruffw/github-actions-models that referenced this issue Jan 18, 2025

Verified

This commit was signed with the committer’s verified signature.
woodruffw William Woodruff
@woodruffw
Copy link
Owner

No problem! Sorry the error message there is so opaque -- the models involve a lot of "untagged" structure matching, which with serde means we unfortunately sometimes lose the exact error source that caused the parse failure. I'm going to be looking into improving that separately soon 🙂

@woodruffw woodruffw removed the triage Issue is being triaged label Jan 18, 2025
woodruffw added a commit that referenced this issue Jan 18, 2025

Verified

This commit was signed with the committer’s verified signature.
woodruffw William Woodruff
Fixes #462.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants