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

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

Closed
dragon3 opened this issue Feb 27, 2024 · 7 comments
Closed

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

dragon3 opened this issue Feb 27, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@dragon3
Copy link

dragon3 commented Feb 27, 2024

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.

@rhysd
Copy link
Owner

rhysd commented Feb 27, 2024

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
Copy link
Owner

rhysd commented Feb 27, 2024

@dragon3
Copy link
Author

dragon3 commented Feb 27, 2024

@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?

@rhysd
Copy link
Owner

rhysd commented Feb 27, 2024

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

@rhysd rhysd closed this as completed in 3e2f8ea Feb 27, 2024
@rhysd rhysd added the bug Something isn't working label Feb 27, 2024
@dragon3
Copy link
Author

dragon3 commented Feb 27, 2024

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!

@rhysd
Copy link
Owner

rhysd commented Mar 1, 2024

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?

@dragon3
Copy link
Author

dragon3 commented Mar 4, 2024

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 👍

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

2 participants