sqlfluff / sqlfluff-github-actions

The official resource for SQLFluff related GitHub Actions
MIT License
105 stars 36 forks source link

Remove deprecated GitHub Action set-output command #25

Open epapineau opened 1 year ago

epapineau commented 1 year ago

set-output has been deprecated leading to the following message when using this code snippet:

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/
aballiet commented 9 months ago

Any update ?

jerome-laurent-pro commented 8 months ago

set-output has been deprecated leading to the following message:

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/

@epapineau, I think this isn't enough because the trilom/file-changes-action@v1.2.4 GH action also uses set-output. I replaced it by Ana06/get-changed-files@v2.3.0 that is up to date, and it works. Do you want me to update your PR?

@aballiet if you want to update your own workflow before the PR is accepted, you can replace the get_file_changes and get_files_to_lint steps by something like this will and it should work:

      - name: Get changed files
        id: get_file_changes
        uses: Ana06/get-changed-files@v2.3.0
        with:
          format: 'space-delimited'
          filter: '*'

      - name: Get new and changed .sql files in /models to lint
        id: get_files_to_lint
        shell: bash -l {0}
        run: |
          # Set the command in the $() brackets as an output to use in later steps
          echo "lintees=$(
          # Issue where grep regular expressions don't work as expected on the
          # Github Actions shell, check dbt/models/ folder
          echo \
          $(echo ${{ steps.get_file_changes.outputs.modified }} |
          tr -s ' ' '\n' |
          grep -E '^models.*[.]sql$' |
          tr -s '\n' ' ') \
          $(echo ${{ steps.get_file_changes.outputs.added }} |
          tr -s ' ' '\n' |
          grep -E '^models.*[.]sql$' |
          tr -s '\n' ' ')
          )" >> $GITHUB_OUTPUT
epapineau commented 8 months ago

@jerome-laurent-pro I haven't seen any comment / feedback on the PR, feel free to do as you wish with it~✨