Skip to content

v1.6.18

Compare
Choose a tag to compare
@github-actions github-actions released this 17 Sep 13:48
· 692 commits to main since this release
  • This release much enhances checks for local reusable workflow calls. Note that these checks are done for local reusable workflows (starting with ./). (#179).
    • Detect missing required inputs/secrets and undefined inputs/secrets at jobs.<job_id>.with and jobs.<job_id>.secrets. See the document for more details.
      # .github/workflows/reusable.yml
      on:
        workflow_call:
          inputs:
            name:
              type: string
              required: true
          secrets:
            password:
              required: true
      ...
      
      # .github/workflows/test.yml
      ...
      
      jobs:
        missing-required:
          uses: ./.github/workflows/reusable.yml
          with:
            # ERROR: Undefined input "user"
            user: rhysd
            # ERROR: Required input "name" is missing
          secrets:
            # ERROR: Undefined secret "credentials"
            credentials: my-token
            # ERROR: Required secret "password" is missing
    • Type check for reusable workflow inputs at jobs.<job_id>.with. Types are defined at on.workflow_call.inputs.<name>.type in reusable workflow. actionlint checks types of expressions in workflow calls. See the document for more details.
      # .github/workflows/reusable.yml
      on:
        workflow_call:
          inputs:
            id:
              type: number
            message:
              type: string
      ...
      
      # .github/workflows/test.yml
      ...
      
      jobs:
        type-checks:
          uses: ./.github/workflows/reusable.yml
          with:
            # ERROR: Cannot assign string value to number input. format() returns string value
            id: ${{ format('runner name is {0}', runner.name) }}
            # ERROR: Cannot assign null to string input. If you want to pass string "null", use ${{ 'null' }}
            message: null
    • Detect local reusable workflow which does not exist at jobs.<job_id>.uses. See the document for more details.
      jobs:
        test:
          # ERROR: This workflow file does not exist
          with: ./.github/workflows/does-not-exist.yml
    • Check needs.<job_id>.outputs.<output_id> in downstream jobs of workflow call jobs. The outputs object is now typed strictly based on on.workflow_call.outputs.<name> in the called reusable workflow. See the document for more details.
      # .github/workflows/get-build-info.yml
      on:
        workflow_call:
          outputs:
            version:
              value: ...
              description: version of software
      ...
      
      # .github/workflows/test.yml
      ...
      
      jobs:
        # This job's outputs object is typed as {version: string}
        get_build_info:
          uses: ./.github/workflows/get-build-info.yml
        downstream:
          needs: [get_build_info]
          runs-on: ubuntu-latest
          steps:
            # OK. `version` is defined in the reusable workflow
            - run: echo '${{ needs.get_build_info.outputs.version }}'
            # ERROR: `tag` is not defined in the reusable workflow
            - run: echo '${{ needs.get_build_info.outputs.tag }}'
  • Add missing properties in contexts and improve types of some properties looking at the official contexts document.
    • github.action_status
    • runner.debug
    • services.<service_id>.ports
  • Fix on.workflow_call.inputs.<name>.description and on.workflow_call.secrets.<name>.description were incorrectly mandatory. They are actually optional.
  • Report parse errors when parsing action.yml in local actions. They were ignored in previous versions.
  • Sort the order of properties in an object type displayed in error message. In previous versions, actionlint sometimes displayed {a: true, b: string}, or it displayed {b: string, a: true} for the same object type. This randomness was caused by random iteration of map values in Go.
  • Update popular actions data set to the latest.