Improved documentation around sequence of saveState and getState
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 5.9k
- Forks
- 1.8k
- PR merge metrics
- No merged PRs in 30d
Description
Upon writing my first action, I found it surprising that after issuing a call like core.saveState('foo', 'bar') I could not immediately core.getState('foo') back from the environment. After reading the code a bit, I sort of understand why. Although core.getState is reading directly from the environment variables, core.saveState is writing to stdout.
The docs for sending values to pre and post actions implies this. (emphasis mine)
The
STATE_processIDvariable is then exclusively available to the cleanup script running under the main action.
It would be nice if the documentation around core.saveState and core.getState explicitly mentioned this. I didn't initially expect this behavior.
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with the documentation for core.saveState and core.getState and compare it with the linked GitHub Actions workflow-commands reference. Update the documentation to explain that saveState writes to stdout and its value is not immediately available through getState, including the pre/post action scope. Done means the sequence and limitation are explicit.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 2/5
- Estimated time
- 1-3 hours
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100