Skip to content

Commit

Permalink
Revert "Replace set-output as its deprecated by github (#315)"
Browse files Browse the repository at this point in the history
This reverts commit faa376f.

This change ([release 1.2.8][1]) broke the output functionality
unfortunately, so reverting it.  Will look into the cause in due course
(it's not urgent, as the [`set-output` functionality will not be
deprecated until 31st May 2023][2]).

[1]: https://github.com/agilepathway/label-checker/releases/tag/v1.2.8
[2]: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
  • Loading branch information
johnboyes committed Nov 22, 2022
1 parent faa376f commit 4b2dfdc
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 fmt.Sprintf("echo 'label_check=%s' >> $GITHUB_OUTPUT", result)
return "::set-output name=label_check::" + 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 += "echo 'label_check=failure' >> $GITHUB_OUTPUT\n"
tc.expectedStdout += "::set-output name=label_check::failure\n"
tc.expectedStderr = "Error: " + tc.expectedStderr
} else {
tc.expectedStdout += "echo 'label_check=success' >> $GITHUB_OUTPUT\n"
tc.expectedStdout += "::set-output name=label_check::success\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 += "echo 'label_check=failure' >> $GITHUB_OUTPUT\n"
tc.expectedStdout += "::set-output name=label_check::failure\n"
tc.expectedStderr = "Error: " + tc.expectedStderr
} else {
tc.expectedStdout += "echo 'label_check=success' >> $GITHUB_OUTPUT\n"
tc.expectedStdout += "::set-output name=label_check::success\n"
}
setPullRequestNumber(tc.prNumber)
tc.specifyChecks()
Expand Down

0 comments on commit 4b2dfdc

Please sign in to comment.