Skip to content

Is it possible to give the previous step output as argument to the script? #183

Open
@LakshmiRavali

Description

@LakshmiRavali

Can we pass the previous step output as an argument to the script?

get-data:
    runs-on: ubuntu-latest
    outputs:
      change-log: ${{ steps.update-specs.outputs.change-log }}
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
      - name: Test
        run: |
          echo "::set-output name=change-log::testChange"
  release:
    runs-on: ubuntu-latest
    needs: [get-data]
    steps:
      - name: Checkout repo
        uses: actions/checkout@v2
      - run: |
          git pull
          npm install
      - name: semanticRelease
        run: |
          npm i --save-dev @semantic-release/exec
          npx semantic-release -t \${version}
        env:
          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

package.json:

"plugins": [
        "@semantic-release/commit-analyzer",
        "@semantic-release/release-notes-generator",
      [
        "@semantic-release/changelog",
        {
          "changelogFile": "CHANGES.md"
        }
      ],
      [
        "@semantic-release/npm",
        {
          "npmPublish": false
        }
      ],
      "@semantic-release/github",
      [
        "@semantic-release/git",
        {
          "assets": [
            "CHANGES.md",
            "package.json"
          ],
          "message": "chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
        }
      ],
      [
        "@semantic-release/exec",
        {
          "successCmd": "node .github/scripts/build.js ${nextRelease.version}"  // Here Can we pass the change-log variable of get-data step?
        }
      ]
    ]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions