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

core.setOutput not being recognized as property #104

Closed
estokes-vs opened this issue Jan 7, 2022 · 3 comments
Closed

core.setOutput not being recognized as property #104

estokes-vs opened this issue Jan 7, 2022 · 3 comments

Comments

@estokes-vs
Copy link

When using the following @actions/core package, I'm setting an output and then trying to reference it in a downstream action. The output is available and proper, but actionlint is throwing the following error which indicates that the only property of outputs that is available is results:

.github/workflows/ci.yml:21:33: property "color" is not defined in object type {result: string} [expression]

When calling ${{ steps.assign.outputs.results }} it doesn't return anything. I'm not sure if I'm doing something wrong or frowned upon with this mechanism, but wanted to open this issue to see if anyone else has ran into the problem?

Playground (which I think is awesome)

Code excerpt of how the setOutput command functions:
https://github.com/actions/toolkit/blob/27f76dfe1afb2b7e5e679cd8e97192d34d8320e6/packages/core/src/core.ts#L190

export function setOutput(name: string, value: any): void {
  process.stdout.write(os.EOL)
  issueCommand('set-output', {name}, value)
}

Github Action example:

jobs:
  test-workflow:
    name: color is cool
    runs-on: ubuntu-latest
    steps:
      - id: assign
        uses: actions/github-script@v5
        with:
          script: |
            core.setOutput('color', 'pink');
      - id: call
        run: |
          echo "color is ${{ steps.assign.outputs.color }}"

Screenshot of output being available and read successfully:
image

@rhysd
Copy link
Owner

rhysd commented Mar 18, 2022

This use case was not assumed because the readme doc describes the usage with outputs.result only. Is calling the setOutput method directly a correct usage of the action?

@rhysd
Copy link
Owner

rhysd commented Apr 6, 2022

This was fixed at 1.6.11.

@TomerFi
Copy link

TomerFi commented May 6, 2022

Just sharing:

The current version the super-linter is 4.9.2,
still includes version 1.6.10 of actionlint.

I switched to using latest to work around this until a new version of super-linter will be released,
as it seems the fix was already staged, but not yet released.

TomerFi added a commit to TomerFi/alexa-skills-tester that referenced this issue May 6, 2022
TomerFi added a commit to TomerFi/alexa-skill-shabbat-times that referenced this issue May 6, 2022
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

No branches or pull requests

3 participants