runner icon indicating copy to clipboard operation
runner copied to clipboard

Inputs context not available in workflows triggered by cron jobs

Open smol-ninja opened this issue 7 months ago • 0 comments

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.

smol-ninja avatar Jul 17 '24 12:07 smol-ninja