From f8773c5fd82fd054a6fb40e84c7a88edddec02c1 Mon Sep 17 00:00:00 2001 From: Jen Jones Arnesen Date: Mon, 2 Dec 2024 14:12:11 +0100 Subject: [PATCH] chore: use output rather than env var --- .github/workflows/release.yml | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index a29e5d648..1e1e6a8f4 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -13,7 +13,6 @@ env: GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}} D2_APP_HUB_TOKEN: ${{secrets.DHIS2_BOT_APPHUB_TOKEN}} CI: true - build_exists: false jobs: release: @@ -21,6 +20,8 @@ jobs: if: > ${{ !github.event.push.repository.fork && github.actor != 'dependabot[bot]' }} + outputs: + build_exists: ${{ steps.check_build.outputs.build_exists }} steps: - uses: actions/checkout@v4 with: @@ -39,17 +40,17 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.DHIS2_BOT_GITHUB_TOKEN }} - - name: Set build_exists env var + - name: Set build_exists output id: check_build run: | if ls build/bundle/maps-*.zip 1> /dev/null 2>&1; then - echo "build_exists=true" >> $GITHUB_ENV + echo "build_exists=yes" >> $GITHUB_OUTPUT else - echo "build_exists=false" >> $GITHUB_ENV + echo "build_exists=no" >> $GITHUB_OUTPUT fi - name: Publish to AppHub - if: env.build_exists == 'true' + if: ${{ steps.check_build.outputs.build_exists == 'yes' }} run: yarn run d2-app-scripts publish report-release-result: @@ -58,19 +59,19 @@ jobs: needs: release steps: - name: Checkout code - if: ${{ env.build_exists == 'true' && success() }} + if: ${{ needs.release.outputs.build_exists == 'yes' && success() }} uses: actions/checkout@v4 with: ref: master fetch-depth: 0 - name: Extract version - if: ${{ env.build_exists == 'true' && success() }} + if: ${{ needs.release.outputs.build_exists == 'yes' && success() }} id: extract_version uses: Saionaro/extract-package-version@v1.3.0 - name: Send success message to analytics-internal-bot slack channel - if: ${{ env.build_exists == 'true' && success() }} + if: ${{ needs.release.outputs.build_exists == 'yes' && success() }} id: slack_success uses: slackapi/slack-github-action@v1.27.0 with: