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

Inputs context not available in workflows triggered by cron jobs #3394

Open
smol-ninja opened this issue Jul 17, 2024 · 0 comments
Open

Inputs context not available in workflows triggered by cron jobs #3394

smol-ninja opened this issue Jul 17, 2024 · 0 comments
Labels
bug Something isn't working

Comments

@smol-ninja
Copy link

Describe the bug
The inputs context does not seem available in the with context of workflows triggered by the cron jobs.

To Reproduce
Use the following template:

on:
  schedule:
    - cron: "0 3 * * 0" # at 3:00am UTC every Sunday
  workflow_dispatch:
    inputs:
      unitFuzzRuns:
        default: '50000'
        description: "Unit: number of fuzz runs."
        required: false

jobs:
  lint:
    uses: "sablier-labs/reusable-workflows/.github/workflows/forge-lint.yml@main"

  build:
    uses: "sablier-labs/reusable-workflows/.github/workflows/forge-build.yml@main"

  test-unit:
    needs: ["lint", "build"]
    uses: "sablier-labs/reusable-workflows/.github/workflows/forge-test.yml@main"
    with:
      foundry-fuzz-runs: ${{ fromJSON(inputs.unitFuzzRuns) || 50000 }}
      foundry-profile: "test-optimized"
      match-path: "test/unit/**/*.sol"
      name: "Unit tests"

Fails

The template is not valid. .github/workflows/ci-deep.yml (Line: 53, Col: 26): Error parsing fromJson,
.github/workflows/ci-deep.yml (Line: 53, Col: 26): Error reading JToken from JsonReader. Path '', line 0, position 0.

Expected behavior
The foundry-fuzz-runs: ${{ fromJSON(inputs.unitFuzzRuns) || 50000 }} line should be passing the default value as an integer to the workflow.

Runner Version and Platform

GitHub hosted runner

OS of the machine running the runner? OSX/Windows/Linux/...
Linux

What's not working?

The template is not valid. .github/workflows/ci-deep.yml (Line: 53, Col: 26): Error parsing fromJson,

Note

It was working before and stopped working a couple of weeks back. Previously, I was not using fromJSON but it was working find then I thought may be Github changed something and added fromJSON. It works when triggered manually but doesn't work when dispatched by the scehduler.

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

No branches or pull requests

1 participant