actionlint icon indicating copy to clipboard operation
actionlint copied to clipboard

False Positive with actions/download-artifact Action download-path Output

Open bflad opened this issue 2 years ago • 3 comments

Description

Version (installed via brew install actionlint):

$ actionlint -version
1.6.22
installed by building from source
built with go1.19.2 compiler for darwin/arm64

Given these steps:

# ...
      - if: inputs.release-notes
        id: release-notes-download
        name: Release Notes Download
        uses: actions/download-artifact@v3
        with:
          name: release-notes
          path: /tmp
      - if: inputs.release-notes
        name: goreleaser release (with release notes)
        uses: goreleaser/goreleaser-action@v4
        with:
          args: release --release-notes ${{ steps.release-notes-download.outputs.download-path }}/release-notes.txt --rm-dist ${{ inputs.goreleaser-release-args }}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
          GPG_FINGERPRINT: ${{ steps.import_gpg.outputs.fingerprint }}

Returns the following error:

$ actionlint             
.github/workflows/community.yml:59:45: property "download-path" is not defined in object type {} [expression]
   |
59 |           args: release --release-notes ${{ steps.release-notes-download.outputs.download-path }}/release-notes.txt --rm-dist ${{ inputs.goreleaser-release-args }}
   |  

The full workflow file can be found here: https://github.com/hashicorp/ghaction-terraform-provider-release/blob/ef2f0c92ac9b5b15fd802308798f6e3e00840e53/.github/workflows/community.yml

actions/download-artifact (at least v3) supports a download-path output:

  • https://github.com/actions/download-artifact#download-path-output
  • https://github.com/actions/download-artifact/blob/9782bd6a9848b53b110e712e20e42d89988822b7/src/download-artifact.ts#L54

This output does not appear to be defined in the popular actions file:

https://github.com/rhysd/actionlint/blob/3a2f2c755b6442ec7999b28dfd107e1bb9853389/popular_actions.go#L636-L642

bflad avatar Jan 04 '23 19:01 bflad

Looks like the output is not present in the actions.yml: https://github.com/actions/download-artifact/blob/main/action.yml

And there's already an associated issue: https://github.com/actions/download-artifact/issues/153

Will followup upstream.

Edit: Submitted https://github.com/actions/download-artifact/pull/194

bflad avatar Jan 04 '23 19:01 bflad

Thanks. When new version of actions/download-artifact is released, actionlint will recognize the output by updating popular actions data set.

rhysd avatar Jan 18 '23 13:01 rhysd

I'm still having that issue with 1.6.24, with the downloaded binary or from the docker image.

nvincent-vossloh avatar May 11 '23 08:05 nvincent-vossloh