solvaholic / octodns-sync

GitHub Action to test and deploy DNS settings with OctoDNS
MIT License
28 stars 14 forks source link

`set-output` is being deprecated #94

Closed solvaholic closed 1 year ago

solvaholic commented 1 year ago

Description

The set-output method of setting Action outputs is being deprecated. Use environment files, or something else, instead.

Context

Docs about the deprecation, and about how to handle it: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ https://docs.github.com/en/actions/using-workflows/workflow-commands-for-github-actions#environment-files

solvaholic commented 1 year ago

6a909e6f15ed161ff056f14b9c24a5d1148fdfc9 failed like this:

image
solvaholic commented 1 year ago

d917c7ce6c7eb165c7d4a6f2fae369e72da9fa37 added a comment, but not the expected one:

image

So I think octodns-sync succeeded:

https://github.com/solvaholic/octodns-sync/blob/d917c7ce6c7eb165c7d4a6f2fae369e72da9fa37/scripts/run.sh#L24-L30

And I think the plan output was set:

https://github.com/solvaholic/octodns-sync/blob/d917c7ce6c7eb165c7d4a6f2fae369e72da9fa37/scripts/run.sh#L40-L42

I think that was exposed in the Validate job this way:

    outputs:
      plan: ${{ steps.octodns-sync.outputs.plan }}

If a) the plan file was written and b) it's available as expected in ${{ steps.octodns-sync.outputs.plan }} then I think the changes for issue94 won't affect how the output is used in other workflow job steps. How can I validate whether this are both true?

Maybe try reapplying that sequence of replacements that were required before?

solvaholic commented 1 year ago

9b7573e1d162ef569ef50eee1573521211971bab adds a $ I'd missed 🤦

The env for a run log tells me the environment variables are being set OK:

image

Oh. I see it. I'm using $GITHUB_ENV where I should be using $GITHUB_OUTPUT.

solvaholic commented 1 year ago

🎉 7a47ad1 got the output:

image

It's still not doing what I expect, tho, so I assume I've overlooked something. My test setup in sovahol/dns is running out-of-date octodns, so I'll start by updating that.

solvaholic commented 1 year ago

Ok, 0f3f924 gets it right I think. It even updated the pull request comment 🎉

I'll go ahead and merge these changes into issue92.

barnumbirr commented 1 year ago

@solvaholic any plans on creating a new release to include this change? I'd rather not see the action stop working if Github suddenly disables set-output.

solvaholic commented 1 year ago

Hi @barnumbirr Thank you for bumping this! :bow:

I think I dropped the ball around here: https://github.com/solvaholic/octodns-sync/pull/96#issuecomment-1290845868

I'll pick it up there and, yes, get this change into a release. Should be able to finish that up this coming weekend, 11-12 Feb.