stefanzweifel / git-auto-commit-action

Automatically commit and push changed files back to GitHub with this GitHub Action for the 80% use case.
MIT License
2.06k stars 230 forks source link

Replace set-output usage with GITHUB_OUTPUT #252

Closed amonshiz closed 2 years ago

amonshiz commented 2 years ago

See https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ and the recommended migration.

Should fix #250.

This should prevent warnings (and in the future errors) appearing in GitHub summaries.

Generated using fastmod

; fastmod 'echo "::set-output name=([[:alnum:]\-_]+)::(.*)"' 'echo "${1}=${2}" >> $$GITHUB_OUTPUT'
; fastmod 'assert_line "::set-output name=([[:alnum:]\-_]+)::(.*)"' 'assert_line \'"${1}=${2}" >> $$GITHUB_OUTPUT\''
; fastmod 'assert_line -e "::set-output name=([[:alnum:]\-_]+)::(.*)"' 'assert_line -e \'"${1}=${2}" >> $$GITHUB_OUTPUT\''
; fastmod 'refute_line "::set-output name=([[:alnum:]\-_]+)::(.*)"' 'refute_line \'"${1}=${2}" >> $$GITHUB_OUTPUT\''

Before CleanShot 2022-10-20 at 21 15 11@2x

After CleanShot 2022-10-20 at 21 15 52@2x

stefanzweifel commented 2 years ago

Thanks Andrew! LGTM. Will do some testing in my own test repos in the next couple of days and merge and release this.

(BTW: Great work with the Arc browser. Love it more and more. ❤️ )

amonshiz commented 2 years ago

Hopefully I fixed the tests :) I’m not the world’s best shell programmer so I just kinda yolo’d it on the test updates.

And thank you for the kind words about Arc! I’m so happy to hear you love it!

amonshiz commented 2 years ago

Thank you! I'll update our repo to the new version later today

stefanzweifel commented 2 years ago

Thank you! I'll update our repo to the new version later today

If you reference just @v4 you get the update automatically btw.

amonshiz commented 2 years ago

@stefanzweifel I have updated our references to @v4 but am still seeing the set-output warning. Do we need to reference a specific release also?

Run stefanzweifel/git-auto-commit-action@v4
  with:
    commit_message: [Sourcery] Update generated files
    file_pattern: *.swift
    commit_author: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
    push_options: --dry-run
    branch: amonshiz/amonshiz/prdi-669-fix-swiftlint-output-to-github_output
    repository: .
    commit_user_name: github-actions[bot]
    commit_user_email: github-actions[bot]@users.noreply.github.com
    skip_dirty_check: false
    skip_fetch: false
    skip_checkout: false
    disable_globbing: false
    create_branch: false
  env:
    sourcePackageCache: Stage/SourcePackages
    BUNDLE_OUTPUT_DIRECTORY: xcresult-bundles
    SPM_ARCH: arm64
    GITHUB_TOKEN: 
Started: bash /Users/administrator/actions-runner-work/_actions/stefanzweifel/git-auto-commit-action/v4/entrypoint.sh
INPUT_REPOSITORY value: .
INPUT_STATUS_OPTIONS: 
INPUT_FILE_PATTERN: *.swift
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/
Working tree clean. Nothing to commit.
amonshiz commented 2 years ago

Ah, never mind. I see that you had to set it back to the old format for enterprise users. I’ll update our reference to v4.15.2 to get the changes and silence the warnings for ourselves.

stefanzweifel commented 2 years ago

Yeah, my bad for mentioning you can/should reference v4. I will update the Action in the next couple of days to support both syntaxes. (I really don't want to tag a major version for something silly like this.)

The old syntax is being deprecated by GitHub in June 2023. I will probably remove it – again – by the end of the year, as the majority of Enterprise users will then probably have upgraded their runners.

(Also wanna start a discussion with GitHub, on how to handle such changes in the future better)