actionlint icon indicating copy to clipboard operation
actionlint copied to clipboard

Failed on "google-github-actions/get-secretmanager-secrets"

Open dragon3 opened this issue 2 years ago • 7 comments

Since the version 1.6.27, the actionlint failed on the following correct workflow configuration:

name: test

on:
  push

jobs:
  job_id:
    runs-on: ubuntu-latest

    steps:
    - id: 'secrets'
      uses: 'google-github-actions/get-secretmanager-secrets@v2'
      with:
        secrets: |-
          token:my-project/docker-registry-token

    # other step
    - id: 'publish'
      uses: 'foo/bar@v1'
      env:
        TOKEN: '${{ steps.secrets.outputs.token }}'

📓 This workflow configuration is an example based on https://github.com/google-github-actions/get-secretmanager-secrets?tab=readme-ov-file#outputs

➜  actionlint test.yml
test.yml:21:21: property "token" is not defined in object type {} [expression]
   |
21 |         TOKEN: '${{ steps.secrets.outputs.token }}'
   |                     ^~~~~~~~~~~~~~~~~~~~~~~~~~~
➜  actionlint --version
1.6.27
installed by building from source
built with go1.22.0 compiler for darwin/arm64

I confirmed that 1.6.26 works without error as expected.

dragon3 avatar Feb 27 '24 01:02 dragon3

This is because the action does not define the output in the manifest. I'll make a pull request there.

https://github.com/google-github-actions/get-secretmanager-secrets/blob/main/action.yml

rhysd avatar Feb 27 '24 02:02 rhysd

Created: https://github.com/google-github-actions/get-secretmanager-secrets/pull/283

rhysd avatar Feb 27 '24 02:02 rhysd

@rhysd Thank you for the comment and for creating the pull request.

However, the google-github-actions/get-secretmanager-secrets creates the outputs dynamically from the secrets attribute.

For example, the following configuration creates foo1 and bar2 outputs dynamically.

    - id: 'secrets'
      uses: 'google-github-actions/get-secretmanager-secrets@v2'
      with:
        secrets: |-
          foo1:xxx
          bar2:xxx

# The dynamic outputs can be used in other steps
# ${{ steps.secrets.outputs.foo1 }}
# ${{ steps.secrets.outputs.bar2 }}

Do you have any idea to support that on actionlint?

dragon3 avatar Feb 27 '24 06:02 dragon3

Ah, I see. Then it is not possible to know what output names are used statically.

rhysd avatar Feb 27 '24 07:02 rhysd

Thank you for the comment and for making the change!

I'm looking forward to the next release with the change. Do you have a plan to release it soon?

Thank you!

dragon3 avatar Feb 27 '24 23:02 dragon3

Currently not planned. But I understand that I should make releases more frequently. Meanwhile, would you ignore the error by -ignore or use the latest main branch?

rhysd avatar Mar 01 '24 10:03 rhysd

Thank you for the comment, and sorry for the late reply.

Currently not planned. But I understand that I should make releases more frequently.

I see. No problem, take your time 👍

Meanwhile, would you ignore the error by -ignore or use the latest main branch?

I got it. It's not urgent for me, and I will try either way you suggested if necessary.


Thank you for working on the great product. I appreciate that 👍

dragon3 avatar Mar 04 '24 04:03 dragon3