Skip to content

Commit

Permalink
Replace set-output as its deprecated by github (#315)
Browse files Browse the repository at this point in the history
* Remove Set-output as its deprecated by github

Updated according to
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
  • Loading branch information
skeeping committed Nov 22, 2022
1 parent ea67aa9 commit faa376f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion internal/github/action.go
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,7 @@ func (a *Action) pullRequestNumber() int {
}

func (a *Action) resultStepOutput(result string) string {
return "::set-output name=label_check::" + result
return fmt.Sprintf("echo 'label_check=%s' >> $GITHUB_OUTPUT", result)
}

func (a *Action) token() string {
Expand Down
8 changes: 4 additions & 4 deletions label_checker_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,10 +115,10 @@ func TestLabelChecks(t *testing.T) {
t.Run(name, func(t *testing.T) {
tc.expectedStdout = "Checking GitHub labels ...\n" + tc.expectedStdout
if len(tc.expectedStderr) > 0 {
tc.expectedStdout += "::set-output name=label_check::failure\n"
tc.expectedStdout += "echo 'label_check=failure' >> $GITHUB_OUTPUT\n"
tc.expectedStderr = "Error: " + tc.expectedStderr
} else {
tc.expectedStdout += "::set-output name=label_check::success\n"
tc.expectedStdout += "echo 'label_check=success' >> $GITHUB_OUTPUT\n"
}
setPullRequestNumber(tc.prNumber)
tc.specifyChecks()
Expand Down Expand Up @@ -191,10 +191,10 @@ func TestLabelChecksWithFailureAllowed(t *testing.T) {
t.Run(name, func(t *testing.T) {
tc.expectedStdout = "Checking GitHub labels ...\n" + tc.expectedStdout
if len(tc.expectedStderr) > 0 {
tc.expectedStdout += "::set-output name=label_check::failure\n"
tc.expectedStdout += "echo 'label_check=failure' >> $GITHUB_OUTPUT\n"
tc.expectedStderr = "Error: " + tc.expectedStderr
} else {
tc.expectedStdout += "::set-output name=label_check::success\n"
tc.expectedStdout += "echo 'label_check=success' >> $GITHUB_OUTPUT\n"
}
setPullRequestNumber(tc.prNumber)
tc.specifyChecks()
Expand Down

0 comments on commit faa376f

Please sign in to comment.