Skip to content

"npm outdated" may span across multiple lines #49

@rkrisztian

Description

@rkrisztian

I see the following at https://michaelcurrin.github.io/dev-cheatsheets/cheatsheets/ci-cd/github-actions/persist.html :

Examples

Get output from npm outdated command, if any.

steps:
 - name: Check for outdated packages
   id: vars
   run: |
     OUTDATED=$(npm outdated) || true
     
     echo "OUTDATED={OUTDATED}" >> $GITHUB_OUTPUT
      
 - name: Upgrade
   if: ${{ steps.vars.outputs.OUTDATED != '' }}
   run: npm upgrade

I think this example is just wrong and misleading. The output of npm outdated may span across multiple lines, breaking the expected syntax of GITHUB_OUTPUT.

AFAIK, the right solution is this:
https://github.com/github/docs/pull/21599/files

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions