Skip to content
You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
save

GitHub Action

Persist Data Between Jobs

v1.1

Persist Data Between Jobs

save

Persist Data Between Jobs

Allows data to be shared between jobs and accessed via env variables and step output

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Persist Data Between Jobs

uses: nick-fields/[email protected]

Learn more about this action in nick-fields/persist-action-data

Choose a version

Persist Data Between Jobs

License: MIT

Allows data to be shared between jobs and accessed via env variables and step output


Inputs

data

Optional The data to persist from job

variable

Optional The variable to be used to access data in other jobs

retrieve_variables

Optional Comma delimited list of variables to load into job


Examples

Example storing data

- uses: nick-invision/persist-action-data@v1
  with:
    data: ${{ steps.some-step.output.some-output }}
    variable: SOME_STEP_OUTPUT

Example using data from another job via env variable

- uses: nick-invision/persist-action-data@v1
  with:
    data: ${{ steps.some-step.output.some-output }}
    retrieve_variables: SOME_STEP_OUTPUT, SOME_OTHER_STEP_OUTPUT
- run: echo $SOME_STEP_OUTPUT

Example using data from another job via output

- uses: nick-invision/persist-action-data@v1
  id: global-data
  with:
    data: ${{ steps.some-step.output.some-output }}
    retrieve_variables: SOME_STEP_OUTPUT, SOME_OTHER_STEP_OUTPUT
- run: echo ${{ steps.global-data.outputs.SOME_STEP_OUTPUT }}