Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace deprecated command with environment file #1871

Closed
wants to merge 1 commit into from
Closed

Replace deprecated command with environment file #1871

wants to merge 1 commit into from

Conversation

jongwooo
Copy link

@jongwooo jongwooo commented Oct 1, 2023

What this PR does / why we need it:

Update workflows to use environment file instead of deprecated set-output command.
For more information, see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

I found the workflow files that use set-output command through the following command:

$ find . -name '*.yml' -o -name '*.yaml' | xargs egrep '\bset-output\b'

AS-IS

echo "::set-output name=matrix::{\"include\": $content }"

TO-BE

echo "matrix={\"include\": $content }" >> $GITHUB_OUTPUT

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #1870

Copy link
Member

@mauromorales mauromorales left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @jongwooo thanks for opening the PR! I see that the output is now moved into the ENV var, but I think you might still need to change the consumers e.g., https://github.com/kairos-io/kairos/blob/master/.github/workflows/image.yaml#L65 to also read from that ENV var.

@mauromorales
Copy link
Member

While this does seem to put the content in the output, it seems to have some characters that break it see https://github.com/kairos-io/kairos/actions/runs/6420178340

Error when evaluating 'strategy' for job 'framework'. .github/workflows/image-pr.yaml (Line: 41, Col: 15): Error parsing fromJson,.github/workflows/image-pr.yaml (Line: 41, Col: 15): Unexpected character encountered while parsing value: %. Path 'include', line 1, position 13.,.github/workflows/image-pr.yaml (Line: 41, Col: 15): Unexpected value ''

@jongwooo
Copy link
Author

Error when evaluating 'strategy' for job 'framework'. .github/workflows/image-pr.yaml (Line: 41, Col: 15): Error parsing fromJson,.github/workflows/image-pr.yaml (Line: 41, Col: 15): Unexpected character encountered while parsing value: %. Path 'include', line 1, position 13.,.github/workflows/image-pr.yaml (Line: 41, Col: 15): Unexpected value ''

@mauromorales Sorry for the late reply. I'll take a look at what might be causing this.

@mauromorales
Copy link
Member

@jongwooo no worries and thanks! If it helps, I was testing it out with the following workflow https://github.com/kairos-io/kairos/pull/1889/files#diff-f8c07cbe8adb8afd573be281e6de56b7c0b2c1b88ee9624ab2f79ddacd1ca4b8L25-R41 and as a result you should see a bunch of flavors generate jobs

@mauromorales
Copy link
Member

No progress here and some conflicts so I will close but feel free to re-open any time.

@jongwooo jongwooo deleted the chore/replace-deprecated-command-with-environment-file branch January 4, 2024 15:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace deprecated set-output command with environment file
2 participants