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

Input redirect-to is not working #27

Open
alewkinr opened this issue Sep 25, 2023 · 4 comments · May be fixed by #37
Open

Input redirect-to is not working #27

alewkinr opened this issue Sep 25, 2023 · 4 comments · May be fixed by #37

Comments

@alewkinr
Copy link

alewkinr commented Sep 25, 2023

Hello there!

I’m trying to extract secret from k8s using this GH action, but the problem that I can not access the command output.

I checked the actions.yaml there is an undocumented input redirect-to which seems not working properly.

Here is the example:

steps:
  - name: Get secrets
    id: get-secret
    uses: actions-hub/kubectl@v1.28.2
    env:
     KUBE_HOST: ${{ env.KUBE_HOST }}
     KUBE_CERTIFICATE: ${{ env.KUBE_CERTIFICATE }}
     KUBE_TOKEN: ${{ env.KUBE_TOKEN }}
    with:
     args: get secret ${{ inputs.secret-name }} -n ${{ inputs.namespace }} -o json
     redirect-to: secret-content
  
  - name: Print result
    shell: bash
    run: echo "${{ steps.get-secret.outputs.secret-content }}"

And that is debug output:

[GitHub Actions Debug Workflow/actions-debug] [DEBUG] expression 'echo "${{ steps.get-secret.outputs.secret-content }}"' rewritten to 'format('echo "{0}"', steps.get-secret.outputs.secret-content)'
[GitHub Actions Debug Workflow/actions-debug] [DEBUG] evaluating expression 'format('echo "{0}"', steps.get-secret.outputs.secret-content)'
[GitHub Actions Debug Workflow/actions-debug] [DEBUG] expression 'format('echo "{0}"', steps.get-secret.outputs.secret-content)' evaluated to '%!t(string=echo "")'

Executing github action locally with: https://github.com/nektos/act

@exelban
Copy link
Member

exelban commented Sep 25, 2023

emm, yes. It's not working properly.
Because there is no such input.

@exelban exelban closed this as completed Sep 25, 2023
@alewkinr
Copy link
Author

emm, yes. It's not working properly.
Because there is no such input.

@exelban what do you mean? I see it in action.yamlhttps://github.com/actions-hub/kubectl/blob/6fd9eb2486a67fab3b011befdf3cfcc4e64d9655/action.yml#L7C1-L13C20

@exelban
Copy link
Member

exelban commented Sep 25, 2023

hmm, yeap. Looks like I merge something without checking if it works(
will take a look

@exelban exelban reopened this Sep 25, 2023
@alewkinr
Copy link
Author

@exelban I will make I PR with a proper fix of this issue if you do not mind.

@Lewis-Globacap Lewis-Globacap linked a pull request Sep 11, 2024 that will close this issue
2 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants