Wandalen/wretry.action

TypeError: Input does not meet YAML 1.2

ben-manes opened this issue · 14 comments

It appears that this action has evaluation problems when mixed with one that has a default expression. When that is overridden or the retry wrapper removed then the warnings don't appear. The simple workaround is to then to set the value explicitly to avoid this evaluation gotcha, but it would be nice for this action to handle it appropriately.

Original investigation is described in gradle/gradle-build-action#316

Action definition
cache-read-only:
  description: |
    When 'true', existing entries will be read from the cache but no entries will be written.
    By default this value is 'false' for workflows on the GitHub default branch and 'true' for workflows on other branches.
  required: false
  default: ${{ github.ref_name != github.event.repository.default_branch }}
Error details
Warning: Unhandled error in Gradle post-action - job will continue: TypeError: Input does not meet YAML 1.2 "Core Schema" specification: cache-read-only
[8](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:8)
Support boolean input list: `true | True | TRUE | false | False | FALSE`
[9](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:9)
TypeError: Input does not meet YAML 1.2 "Core Schema" specification: cache-read-only
[10](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:10)
Support boolean input list: `true | True | TRUE | false | False | FALSE`
[11](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:11)
    at Object.getBooleanInput (/home/runner/work/_actions/Wandalen/gradle-build-action/dist/webpack:/gradle-build-action/node_modules/@actions/core/lib/core.js:151:1)
[12](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:12)
    at isCacheReadOnly (/home/runner/work/_actions/Wandalen/gradle-build-action/dist/webpack:/gradle-build-action/src/cache-utils.ts:60:1)
[13](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:13)
    at Object.<anonymous> (/home/runner/work/_actions/Wandalen/gradle-build-action/dist/webpack:/gradle-build-action/src/caches.ts:77:1)
[14](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:14)
    at Generator.next (<anonymous>)
[15](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:15)
    at /home/runner/work/_actions/Wandalen/gradle-build-action/dist/webpack:/gradle-build-action/src/caches.ts:31:1
[16](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:16)
    at new Promise (<anonymous>)
[17](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:17)
    at __webpack_modules__.3800.__awaiter (/home/runner/work/_actions/Wandalen/gradle-build-action/dist/webpack:/gradle-build-action/src/caches.ts:27:1)
[18](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:18)
    at Object.save (/home/runner/work/_actions/Wandalen/gradle-build-action/dist/webpack:/gradle-build-action/src/caches.ts:73:1)
[19](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:19)
    at Object.<anonymous> (/home/runner/work/_actions/Wandalen/gradle-build-action/dist/webpack:/gradle-build-action/src/setup-gradle.ts:79:1)
[20](https://github.com/ben-manes/caffeine/runs/6786982478?check_suite_focus=true#step:36:20)
    at Generator.next (<anonymous>)

Hello, @ben-manes

It's is a feature that is not implemented yet.
I know the action cannot read default values that contain some context variables ( the answer to related issue ).

I'll solve the issue as soon as I can.

Thanks @dmvict! It’s not an issue for me and I am simply reporting the warnings upstream. Thanks for the useful action.

Hello, @ben-manes

I've added the feature for resolving inputs from contexts. See pull request #50.
After publishing, the action will resolve inputs from contexts env and github. Maybe, it's enough for the most actions. Or I will work with new issues :)

I hope that the new version will help you.

Thanks! 😁

Hello, @ben-manes

The new version was released.

Please, try to use external action with implicit context-based defaults.
Report new problems or confirm that your problem is solved.

It fails 🙁

The requested context "job" does not supported by action.
ben-manes/caffeine#731

As I said before

Maybe, it's enough for the most actions. Or I will work with new issues :)

I'll try to add job context this week.

Thanks, the matrix context is also required for my usage.

Thanks, the matrix context is also required for my usage.

Do you know the action using this context? Or, does your workflow has an expression ${{ matrix.xxx }}?

I use the expression in the workflow.

Hello, @ben-manes

I added full support of job context in #57
Basic support implemented in #56.

New release should solve your issue.

Thanks @dmvict,

I'll need support for matrix before I can upgrade (example failure).

Error: The requested context "matrix" does not supported by action.

Hello, @ben-manes

I forgot to inform you about new version of the action.
The action should handle contexts correctly. The non handled context is inputs it is related to the code in the external library:
cschleiden/github-actions-parser#45

Wonderful, thanks!