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

GitHub Action

Get persistent value

v1

Get persistent value

download

Get persistent value

Gets a value that persists through GitHub Actions jobs and workflows

Installation

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

              

- name: Get persistent value

uses: aaimio/get-persistent-value@v1

Learn more about this action in aaimio/get-persistent-value

Choose a version

uptime

Also see aaimio/set-persistent-value

Get persistent value

This action gets a value that persists through GitHub Actions jobs, steps, or workflows.

  • Get a hash that you can use for comparison, e.g. to execute some logic if a file hash has changed.
  • Get a URL that's required in other steps, jobs, or workflows, e.g. getting a Vercel deployment URL to run a Lighthouse report on.
  • Get a boolean value to keep track of whether something was executed or not, e.g. to make sure some logic only runs once.

Configuration

This action takes the below inputs:

  • access_token: Use curl to generate one (or simply visit the URL directly):
    • After generating, add the access token as a GitHub secret for your repo (e.g. PERSISTENT_VALUE_ACCESS_TOKEN).
$ curl https://persistent.aaim.io/api/values/new_access_token?output=plain
  • key: An identifier with which you can retrieve the persistent value.

Set a persistent value

Values can be set using aaimio/set-persistent-value:

steps:
- name: Set a persistent value
  id: set_persistent_value
  uses: aaimio/set-persistent-value@master
  with:
    access_token: ${{ secrets.PERSISTENT_VALUE_ACCESS_TOKEN }}
    key: foo
    value: bar

Get a persistent value

Values can be retrieved using aaimio/get-persistent-value:

steps:
- name: Get a persistent value
  id: get_persistent_value
  uses: aaimio/get-persistent-value@master
  with:
    access_token: ${{ secrets.PERSISTENT_VALUE_ACCESS_TOKEN }}
    key: foo
- name: Some other step
  run: |
    echo ${{ steps.get_persistent_value.outputs.value }}