From 8716547f318eb112dba9175feec972fd959bf141 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 20 Sep 2023 09:08:10 -0400 Subject: [PATCH 1/2] Fix GitHub Action deprecated notices. This fixes several deprecated notices caused by the use of `set-output` and `save-output` in GitHub Action workflows. These were deprecated, and could be removed at any time without notice. GitHub posted an update on July 24th that they still plan on removing these commands but were delaying the removal because of continued high usage. More can be found about this in the announcement posts: - https://github.blog/changelog/2022-10-11-github-actions-deprecating-save-state-and-set-output-commands/ - https://github.blog/changelog/2023-07-24-github-actions-update-on-save-state-and-set-output-commands/ --- .github/workflows/cypress.yml | 8 ++++---- .github/workflows/lint-php.yml | 2 +- .github/workflows/satis-webhook.yml | 4 ++-- .github/workflows/upload-artifact-on-push.yml | 8 ++++---- .github/workflows/upload-asset-on-release.yml | 8 ++++---- .github/workflows/wp-i18n.yml | 6 +++--- 6 files changed, 18 insertions(+), 18 deletions(-) diff --git a/.github/workflows/cypress.yml b/.github/workflows/cypress.yml index 9794c93..4a36cb5 100644 --- a/.github/workflows/cypress.yml +++ b/.github/workflows/cypress.yml @@ -44,8 +44,8 @@ jobs: REPO: ${{ github.repository }} run: | mkdir dist - echo ::set-output name=DIST::${PWD}/dist - echo ::set-output name=PACKAGE::${REPO##*/} + echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT + echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT - name: Use Node.js 16.x uses: actions/setup-node@v3 @@ -54,7 +54,7 @@ jobs: - name: Get npm cache directory id: npm-cache - run: echo "::set-output name=dir::$(npm config get cache)" + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT - name: Cache node modules uses: actions/cache@v3 @@ -67,7 +67,7 @@ jobs: - name: Get Composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer vendor directory uses: actions/cache@v3 diff --git a/.github/workflows/lint-php.yml b/.github/workflows/lint-php.yml index 43f76e5..01b6f8e 100644 --- a/.github/workflows/lint-php.yml +++ b/.github/workflows/lint-php.yml @@ -38,7 +38,7 @@ jobs: - name: Get Composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT if: "!! env.GIT_DIFF" - name: Cache Composer vendor directory diff --git a/.github/workflows/satis-webhook.yml b/.github/workflows/satis-webhook.yml index 7067b8b..757a871 100644 --- a/.github/workflows/satis-webhook.yml +++ b/.github/workflows/satis-webhook.yml @@ -15,11 +15,11 @@ jobs: id: package env: REPO: ${{ github.repository }} - run: echo ::set-output name=PACKAGE::${REPO##*/} + run: echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT - name: Set Version id: tag - run: echo ::set-output name=VERSION::${GITHUB_REF##*/} + run: echo "VERSION=${GITHUB_REF##*/}" >> $GITHUB_OUTPUT - name: Repository Dispatch uses: peter-evans/repository-dispatch@v2 diff --git a/.github/workflows/upload-artifact-on-push.yml b/.github/workflows/upload-artifact-on-push.yml index ace0ef6..58af201 100644 --- a/.github/workflows/upload-artifact-on-push.yml +++ b/.github/workflows/upload-artifact-on-push.yml @@ -39,8 +39,8 @@ jobs: REPO: ${{ github.repository }} run: | mkdir dist - echo ::set-output name=DIST::${PWD}/dist - echo ::set-output name=PACKAGE::${REPO##*/} + echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT + echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT - name: Use Node.js 16.x uses: actions/setup-node@v3 @@ -49,7 +49,7 @@ jobs: - name: Get npm cache directory id: npm-cache - run: echo "::set-output name=dir::$(npm config get cache)" + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT - name: Cache node modules uses: actions/cache@v3 @@ -61,7 +61,7 @@ jobs: - name: Get Composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer vendor directory uses: actions/cache@v3 diff --git a/.github/workflows/upload-asset-on-release.yml b/.github/workflows/upload-asset-on-release.yml index f7e3892..1c39069 100644 --- a/.github/workflows/upload-asset-on-release.yml +++ b/.github/workflows/upload-asset-on-release.yml @@ -51,8 +51,8 @@ jobs: REPO: ${{ github.repository }} run: | mkdir dist - echo ::set-output name=DIST::${PWD}/dist - echo ::set-output name=PACKAGE::${REPO##*/} + echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT + echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT - name: Set Node.js 16.x uses: actions/setup-node@v3 @@ -61,7 +61,7 @@ jobs: - name: Get npm cache directory id: npm-cache - run: echo "::set-output name=dir::$(npm config get cache)" + run: echo "dir=$(npm config get cache)" >> $GITHUB_OUTPUT - name: Cache node modules uses: actions/cache@v3 @@ -73,7 +73,7 @@ jobs: - name: Get Composer Cache Directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer vendor directory uses: actions/cache@v3 diff --git a/.github/workflows/wp-i18n.yml b/.github/workflows/wp-i18n.yml index f865b84..c1c18d7 100644 --- a/.github/workflows/wp-i18n.yml +++ b/.github/workflows/wp-i18n.yml @@ -24,8 +24,8 @@ jobs: REPO: ${{ github.repository }} run: | mkdir dist - echo ::set-output name=DIST::${PWD}/dist - echo ::set-output name=PACKAGE::${REPO##*/} + echo "DIST=${PWD}/dist" >> $GITHUB_OUTPUT + echo "PACKAGE=${REPO##*/}" >> $GITHUB_OUTPUT - name: Setup PHP uses: shivammathur/setup-php@v2 @@ -36,7 +36,7 @@ jobs: - name: Get Composer cache directory id: composer-cache - run: echo "::set-output name=dir::$(composer config cache-files-dir)" + run: echo "dir=$(composer config cache-files-dir)" >> $GITHUB_OUTPUT - name: Cache Composer vendor directory uses: actions/cache@v3 From 1ee9e4253bb3ae821b4eae07219bd4426a8e4bf1 Mon Sep 17 00:00:00 2001 From: Jonathan Desrosiers Date: Wed, 20 Sep 2023 09:58:48 -0400 Subject: [PATCH 2/2] Remove use of UnicornGlobal/has-changes-action action. This action contains an occurrance of `set-output`, which has been depreceted and will soon be removed. --- .github/workflows/wp-i18n.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/wp-i18n.yml b/.github/workflows/wp-i18n.yml index c1c18d7..c90b2b6 100644 --- a/.github/workflows/wp-i18n.yml +++ b/.github/workflows/wp-i18n.yml @@ -72,10 +72,11 @@ jobs: - name: Check if there are file changes id: changes - uses: UnicornGlobal/has-changes-action@v1.0.12 + continue-on-error: true + run: git diff --exit-code - name: Commit web files - if: steps.changes.outputs.changed == 1 + if: steps.changes.outcome == 'failure' run: | git config --local user.name "${{ github.event.head_commit.author.name }}" git config --local user.email "${{ github.event.head_commit.author.email }}" @@ -85,7 +86,7 @@ jobs: git status - name: Push changes - if: steps.changes.outputs.changed == 1 + if: steps.changes.outcome == 'failure' uses: ad-m/github-push-action@master with: github_token: ${{ secrets.GITHUB_TOKEN }}