openrewrite / openrewrite/rewrite-github-actions
Replace usage of `set-output` and `save-state`
Nobody has claimed this yet.
- Dominant language
- Java
- Stars
- 1
- Forks
- 9
- Avg merge
- 5h 27m
- Merged PRs (30d)
- 12
Description
A workflow using save-state or set-output like the following
- name: Save state
run: echo "::save-state name={name}::{value}"
- name: Set output
run: echo "::set-output name={name}::{value}"
Should be updated to write to the new GITHUB_STATE and GITHUB_OUTPUT environment files:
- name: Save state
run: echo "{name}={value}" >> $GITHUB_STATE
- name: Set output
run: echo "{name}={value}" >> $GITHUB_OUTPUT
https://github.com/search?l=YAML&q=set-output&type=Code
Note: This recipe needs to be used with runners 2.297.0 or above. We need to warn users about that. See https://github.com/community/community/discussions/36746
Also, the syntax is a little bit different for Windows runners:
https://github.com/orgs/community/discussions/26313#discussioncomment-4467564
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 by locating the repository's GitHub Actions migration recipe definitions and their tests, then compare the issue's set-output and save-state examples with the documented GITHUB_OUTPUT and GITHUB_STATE syntax. Check both Unix and Windows runner forms and account for the stated runner version requirement. Done means the recipe handles the replacement and warns users about runner compatibility.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- github-actions, yaml
- Domain
- ci-cd, devops
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100