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

Warning in Changelog Enforcer output #222

Closed
mathomp4 opened this issue Nov 28, 2022 · 14 comments
Closed

Warning in Changelog Enforcer output #222

mathomp4 opened this issue Nov 28, 2022 · 14 comments
Labels
bug Something isn't working

Comments

@mathomp4
Copy link
Contributor

Describe the bug

I recently tried adding the Changelog Enforcer to a repo and was doing the usual "Will it fail without a changelog change?" test and in the action output I saw:

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/

Thought I'd let you know.

To Reproduce

I think this should happen all the time as it's GitHub itself issuing the warning.

Expected behavior

I suppose no warning? 😄

A link to or sample of your workflow

name: "Enforce Changelog"
on:
  pull_request:
      types: [opened, synchronize, reopened, ready_for_review, labeled, unlabeled]

jobs:
  # Enforces the update of a changelog file on every pull request
  changelog:
    runs-on: ubuntu-latest
    steps:
    - uses: dangoslen/changelog-enforcer@v3
      with:
        changeLogPath: 'ChangeLog.md'
        skipLabels: 'skip changelog'
        missingUpdateErrorMessage: >
            No update to ChangeLog.md found! Please add a changelog
            entry to it describing your change.  Please note that the
            keepachangelog (https://keepachangelog.com) format is
            used. If your change is very trivial not applicable for a
            changelog entry, add a 'Skip Changelog' label to the pull
            request to skip the changelog enforcer.
@mathomp4 mathomp4 added the bug Something isn't working label Nov 28, 2022
@dangoslen
Copy link
Owner

Thanks, @mathomp4

I'm aware and just haven't had the chance to go back through each workflow. But I'll try to get through it today.

@mathomp4
Copy link
Contributor Author

Thanks, @mathomp4

I'm aware and just haven't had the chance to go back through each workflow. But I'll try to get through it today.

@dangoslen I figured you were and frankly I only noticed it because I was checking to see if the Error Message looked right to me. Usually the enforcer does its job and I never look at the Actions output

Thanks for the great tool!

@dangoslen
Copy link
Owner

I think this is resolved now as I've removed all set-output commands in the workflows

@tdilauro
Copy link

I am still seeing this warning with v3.3.0...

Run dangoslen/changelog-enforcer@v3.3.0
  with:
    changeLogPath: CHANGELOG.md
    skipLabels: no-changelog
    versionPattern: ^## \[((v|V)?\d*\.\d*\.\d*-?\w*|unreleased|Unreleased|UNRELEASED)\]
    token: ***
Skip Labels: no-changelog
Changelog Path: CHANGELOG.md
Missing Update Error Message: No update to CHANGELOG.md found!
Expected Latest Version: 
Version Pattern: ^## \[((v|V)?\d*\.\d*\.\d*-?\w*|unreleased|Unreleased|UNRELEASED)\]

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Error: No update to CHANGELOG.md found!

Here is an example of the workflow...

name: CI

on:
  # will run on all PRs that are opened or updated (synchronized)
  pull_request:
    types: [opened, synchronize, reopened]

jobs:
  # changelog must be edited for every PR
  changelog:
    name: Updates Changelog
    runs-on: ubuntu-latest
    steps:
      - uses: dangoslen/changelog-enforcer@v3.3.0
        with:
          changeLogPath: "CHANGELOG.md"
          skipLabels: "no-changelog"

@tdilauro
Copy link

Interestingly, I do not get this warning when a I set a no-changelog label, which activates the skipLabels behavior. In that case, I get the same log output up through the Version Pattern line, but it ends there without the Warning: or the Error: lines in my previous post.

Perhaps an external dependency that still relies on the deprecated behavior is used to fail the job or produce the error message.

@tdilauro
Copy link

Without the no-changelog label and the skipLabels behavior, providing an updated changelog, also results in NO Warning: or Error:. So, it appears that the deprecated behavior appears only on the failure path and not on any of the happy paths.

@dangoslen
Copy link
Owner

Hi @tdilauro! Thanks for taking another look at this issue.

Your analysis seems correct to me. I don't use ::set-output command manually at all but rely on the GitHub actions lib. I'll make sure the enforcer gets upgraded to use a version that doesn't call that.

@dangoslen dangoslen reopened this Mar 11, 2023
@dangoslen
Copy link
Owner

Looks like I missed a dependabot PR from a while ago - #234

And it says in the changelog

1.10.0

  • saveState and setOutput now use environment files if available #1178
  • getMultilineInput now correctly trims whitespace by default #1185

I've now merged that and will push a 3.3.1 version

@tdilauro
Copy link

Hi, @dangoslen.

Unfortunately, we're still seeing the same warning with v3.3.1:

Run dangoslen/changelog-enforcer@v3.3.1
  with:
    changeLogPath: CHANGELOG.md
    skipLabels: no-changelog
    versionPattern: ^## \[((v|V)?\d*\.\d*\.\d*-?\w*|unreleased|Unreleased|UNRELEASED)\]
    token: ***
Skip Labels: no-changelog
Changelog Path: CHANGELOG.md
Missing Update Error Message: No update to CHANGELOG.md found!
Expected Latest Version: 
Version Pattern: ^## \[((v|V)?\d*\.\d*\.\d*-?\w*|unreleased|Unreleased|UNRELEASED)\]

Warning: The `set-output` command is deprecated and will be disabled soon. Please upgrade to using Environment Files. For more information see: https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Error: No update to CHANGELOG.md found!

@dangoslen
Copy link
Owner

@tdilauro could it be you are using an outdated runner? I ask based on the PR that merged the change to use env files in @actions/core mentions there is a difference

@tdilauro
Copy link

@dangoslen It seems unlikely. We're using standard GitHub-provided (rather than private) runners, so I would not expect that to happen. We have been systematically weeding out these errors in our workflows and that seems to be working for other actions, including other jobs in the same workflow.

What do you see in your own tests for a "fail" scenario?

@dangoslen dangoslen reopened this Mar 15, 2023
@dangoslen
Copy link
Owner

@tdilauro ah! I figured this out. I incorrectly build 3.3.1 without updating the new dependencies 🤦🏼

I have a new PR to cut a 3.3.2 release. I'll also add a YANKED bit to the changelog and remove the 3.3.1 tag and direct users to use 3.3.2 instead.

Would you be willing to point your workflow at release/v3.3.2 to verify I've (finally) fixed this?

@tdilauro
Copy link

@dangoslen Looks good...

Run dangoslen/changelog-enforcer@releases/v3.3.2
Skip Labels: no-changelog
Changelog Path: CHANGELOG.md
Missing Update Error Message: No update to CHANGELOG.md found!
Expected Latest Version: 
Version Pattern: ^## \[((v|V)?\d*\.\d*\.\d*-?\w*|unreleased|Unreleased|UNRELEASED)\]
Error: No update to CHANGELOG.md found!

There's no set-output warning on the failure path.

@dangoslen
Copy link
Owner

Thanks for confirming! I'll cut that as a release then.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants