Explorar el Código

Update GitHub Actions for set-output deprecation

GitHub Actions has deprecated set-output. Replace usages of set-output
in stdout with the new syntax to save the output to the new environment
variable.

See:
https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/
Ryan Foster hace 2 años
padre
commit
c85ef77151
Se han modificado 1 ficheros con 15 adiciones y 15 borrados
  1. 15 15
      .github/workflows/main.yml

+ 15 - 15
.github/workflows/main.yml

@@ -93,21 +93,21 @@ jobs:
           if [[ '${{ secrets.MACOS_SIGNING_APPLICATION_IDENTITY }}' != '' && \
                 '${{ secrets.MACOS_SIGNING_INSTALLER_IDENTITY }}' != '' && \
                 '${{ secrets.MACOS_SIGNING_CERT }}' != '' ]] {
-            print '::set-output name=haveCodesignIdent::true'
+            print 'haveCodesignIdent=true' >> $GITHUB_OUTPUT
           } else {
-            print '::set-output name=haveCodesignIdent::false'
+            print 'haveCodesignIdent=false' >> $GITHUB_OUTPUT
           }
 
           if [[ '${{ secrets.MACOS_NOTARIZATION_USERNAME }}' != '' && \
                 '${{ secrets.MACOS_NOTARIZATION_PASSWORD }}' != '' ]] {
-            print '::set-output name=haveNotarizationUser::true'
+            print 'haveNotarizationUser=true' >> $GITHUB_OUTPUT
           } else {
-            print '::set-output name=haveNotarizationUser::false'
+            print 'haveNotarizationUser=false' >> $GITHUB_OUTPUT
           }
           print '::endgroup::'
 
-          print "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
-          print "::set-output name=commitHash::${"$(git rev-parse HEAD)"[0,9]}"
+          print "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
+          print "commitHash=${"$(git rev-parse HEAD)"[0,9]}" >> $GITHUB_OUTPUT
 
       - name: Restore Compilation Cache
         id: ccache-cache
@@ -123,9 +123,9 @@ jobs:
         if: ${{ github.event_name == 'pull_request' }}
         run: |
           if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]] {
-            print '::set-output name=found::true'
+            print 'found=true' >> $GITHUB_OUTPUT
           } else {
-            print '::set-output name=found::false'
+            print 'found=false' >> $GITHUB_OUTPUT
           }
 
       - name: Install Apple Developer Certificate
@@ -205,8 +205,8 @@ jobs:
         id: setup
         run: |
           ## SETUP ENVIRONMENT SCRIPT
-          echo "::set-output name=ccacheDate::$(date +"%Y-%m-%d")"
-          echo "::set-output name=commitHash::$(git rev-parse HEAD | cut -c1-9)"
+          echo "ccacheDate=$(date +"%Y-%m-%d")" >> $GITHUB_OUTPUT
+          echo "commitHash=$(git rev-parse HEAD | cut -c1-9)" >> $GITHUB_OUTPUT
 
       - name: Restore Compilation Cache
         id: ccache-cache
@@ -223,9 +223,9 @@ jobs:
         run: |
           ## GITHUB LABEL SCRIPT
           if [[ -n "$(curl -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -s "${{ github.event.pull_request.url }}" | jq -e '.labels[] | select(.name == "Seeking Testers")')" ]]; then
-            echo '::set-output name=found::true'
+            echo 'found=true' >> $GITHUB_OUTPUT
           else
-            echo '::set-output name=found::false'
+            echo 'found=false' >> $GITHUB_OUTPUT
           fi
 
       - name: Build Plugin
@@ -284,7 +284,7 @@ jobs:
         run: |
           ## SETUP ENVIRONMENT SCRIPT
           $CommitHash = (git rev-parse HEAD)[0..8] -join ''
-          Write-Output "::set-output name=commitHash::${CommitHash}"
+          "commitHash=${CommitHash}" >> $env:GITHUB_OUTPUT
 
       - name: Check for GitHub Labels
         id: seekingTesters
@@ -305,7 +305,7 @@ jobs:
             $false
           }
 
-          Write-Output "::set-output name=found::$(([string]${LabelFound}).ToLower())"
+          "found=$(([string]${LabelFound}).ToLower())" >> $env:GITHUB_OUTPUT
 
       - name: Build Plugin
         uses: ./plugin/.github/actions/build-plugin
@@ -358,7 +358,7 @@ jobs:
         id: metadata
         run: |
           ## METADATA SCRIPT
-          echo "::set-output name=version::${GITHUB_REF/refs\/tags\//}"
+          echo "version=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
 
       - name: Download build artifacts
         uses: actions/download-artifact@v3