You're viewing an older version of this GitHub Action. Do you want to see the latest version instead?
GitHub Action
Get persistent value
v1
Also see aaimio/set-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.
This action takes the below inputs:
access_token
: Usecurl
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
).
- After generating, add the access token as a GitHub secret for your repo (e.g.
$ curl https://persistent.aaim.io/api/values/new_access_token?output=plain
key
: An identifier with which you can retrieve the 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
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 }}