{"id":16547712,"url":"https://github.com/aaimio/get-persistent-value","last_synced_at":"2025-05-08T01:30:50.700Z","repository":{"id":45199729,"uuid":"359122030","full_name":"aaimio/get-persistent-value","owner":"aaimio","description":" Gets a value that persists through GitHub Action jobs, steps, or workflows.","archived":false,"fork":false,"pushed_at":"2023-04-17T17:21:04.000Z","size":319,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-31T10:43:00.747Z","etag":null,"topics":["actions","github-actions","variables"],"latest_commit_sha":null,"homepage":"https://github.com/marketplace/actions/get-persistent-value","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/aaimio.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":"FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null},"funding":{"github":["aaimio"]}},"created_at":"2021-04-18T11:17:39.000Z","updated_at":"2024-06-10T03:07:32.000Z","dependencies_parsed_at":"2022-09-18T04:21:33.287Z","dependency_job_id":null,"html_url":"https://github.com/aaimio/get-persistent-value","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaimio%2Fget-persistent-value","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaimio%2Fget-persistent-value/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaimio%2Fget-persistent-value/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/aaimio%2Fget-persistent-value/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/aaimio","download_url":"https://codeload.github.com/aaimio/get-persistent-value/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":224684662,"owners_count":17352585,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["actions","github-actions","variables"],"created_at":"2024-10-11T19:22:47.592Z","updated_at":"2024-11-14T19:49:40.401Z","avatar_url":"https://github.com/aaimio.png","language":"TypeScript","funding_links":["https://github.com/sponsors/aaimio"],"categories":[],"sub_categories":[],"readme":"![uptime](https://badgen.net/uptime-robot/status/m787894343-bf1ddacfde07d95ec87e488c)\n![uptime](https://badgen.net/uptime-robot/day/m787894343-bf1ddacfde07d95ec87e488c)\n![uptime](https://badgen.net/uptime-robot/week/m787894343-bf1ddacfde07d95ec87e488c)\n![uptime](https://badgen.net/uptime-robot/month/m787894343-bf1ddacfde07d95ec87e488c)\n\n- [Usage](#usage)\n  - [Set a persistent value](#set-a-persistent-value)\n  - [Get a persistent value](#get-a-persistent-value)\n  - [Using the API directly](#using-the-api-directly)\n    - [Setting a value](#setting-a-value)\n    - [Getting a value](#getting-a-value)\n  - [Things to note](#things-to-note)\n\n# Overview\n\n**Set or get a value that persists through GitHub Actions jobs, steps, or workflows.**\n\n- Execute some logic if a file hash has changed\n- Keep track of a URL required in other steps of your workflow (like a Vercel preview URL)\n- Set a boolean value to make other steps in your workflow optional\n\nAny questions, comments, feedback? [Join the #gh-persistent-values channel](https://join.slack.com/t/aaimio/shared_invite/zt-ufy5w5rl-_xPGk4Tew4HyHSiYhsD33w) or [open a new issue](https://github.com/aaimio/set-persistent-value/issues/new).\n\n- [set-persistent-value](https://github.com/aaimio/set-persistent-value)\n- [get-persistent-value](https://github.com/aaimio/get-persistent-value)\n\n## Usage\n\n### [Set a persistent value](https://github.com/aaimio/set-persistent-value)\n\n**Set a single value**\n\nFor single values, the action takes the inputs below:\n\n| Input          | Description                                                                                                                                                                               |\n| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `key`          | The key for the value you want to set                                                                                                                                                     |\n| `value`        | The value to set                                                                                                                                                                          |\n| `access_token` | [Visit this URL](https://persistent.aaim.io/api/values/new_access_token?output=plain), then add this access token as a GitHub secret to your repo (e.g. `PERSISTENT_VALUE_ACCESS_TOKEN`). |\n\n```yaml\nsteps:\n  - name: Set a persistent value\n    id: set_persistent_value\n    uses: aaimio/set-persistent-value@v1.2.1\n    with:\n      key: foo\n      value: bar\n      access_token: ${{ secrets.PERSISTENT_VALUE_ACCESS_TOKEN }}\n```\n\n**Set multiple values**\n\nFor multiple values, the action takes the inputs below:\n\n| Input          | Description                                                                                                                                                                               |\n| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `json`         | A JSON string with the keys and values you want to set                                                                                                                                    |\n| `access_token` | [Visit this URL](https://persistent.aaim.io/api/values/new_access_token?output=plain), then add this access token as a GitHub secret to your repo (e.g. `PERSISTENT_VALUE_ACCESS_TOKEN`). |\n\n```yaml\nsteps:\n  - name: Set a persistent value\n    id: set_persistent_value\n    uses: aaimio/set-persistent-value@v1.2.1\n    with:\n      json: '{ \"some_key\": 42, \"foo\": \"bar\", \"boolean_value\": true }'\n      access_token: ${{ secrets.PERSISTENT_VALUE_ACCESS_TOKEN }}\n```\n\n### [Get a persistent value](https://github.com/aaimio/get-persistent-value)\n\nThis action takes the inputs below:\n\n| Input          | Description                                                                                                                                                                               |\n| -------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| `key`          | The key for the value you want to retrieve                                                                                                                                                |\n| `access_token` | [Visit this URL](https://persistent.aaim.io/api/values/new_access_token?output=plain), then add this access token as a GitHub secret to your repo (e.g. `PERSISTENT_VALUE_ACCESS_TOKEN`). |\n\n```yaml\nsteps:\n  - name: Get a persistent value\n    id: get_persistent_value\n    uses: aaimio/get-persistent-value@v1.2.1\n    with:\n      key: foo\n      access_token: ${{ secrets.PERSISTENT_VALUE_ACCESS_TOKEN }}\n  - name: Some other step\n    run: |\n      echo ${{ steps.get_persistent_value.outputs.value }}\n```\n\n### Using the API directly\n\nIn the background, the action is talking to a simple key-value store.\n\nTo reduce the overhead of downloading the action or introducing yet another step into your workflow, you could also use the API directly:\n\n#### Setting a value\n\n```bash\ncurl -X POST \\\n  -H 'x-api-key: ${{ secrets.PERSISTENT_VALUE_ACCESS_TOKEN }}' \\\n  -H 'x-github-repo: \u003cGITHUB_OWNER/GITHUB_REPO\u003e' \\\n  -H 'content-type: application/json' \\\n  -d '{ \"value\": \"some_value\" }' \\\n  'https://persistent.aaim.io/api/values/set?key=YOUR_KEY\u0026output=plain'\n```\n\n#### Getting a value\n\n```bash\nSOME_VALUE=$(curl -X GET \\\n  -H 'x-api-key: ${{ secrets.PERSISTENT_VALUE_ACCESS_TOKEN }}' \\\n  -H 'x-github-repo: \u003cGITHUB_OWNER/GITHUB_REPO\u003e' \\\n  'https://persistent.aaim.io/api/values/get?key=YOUR_KEY\u0026output=plain')\n\necho $SOME_VALUE\n```\n\n- The `x-github-repo` header is completely optional, it will only keep track of which repositories are using the action or API.\n\n### Things to note\n\n- Items will persist until the `access_token` hasn't been used for 3 months.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaimio%2Fget-persistent-value","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faaimio%2Fget-persistent-value","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faaimio%2Fget-persistent-value/lists"}