Skip to content

Commit

Permalink
chore: use output rather than env var
Browse files Browse the repository at this point in the history
  • Loading branch information
jenniferarnesen committed Dec 2, 2024
1 parent 32a2fe9 commit f8773c5
Showing 1 changed file with 9 additions and 8 deletions.
17 changes: 9 additions & 8 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,15 @@ env:
GH_TOKEN: ${{secrets.DHIS2_BOT_GITHUB_TOKEN}}
D2_APP_HUB_TOKEN: ${{secrets.DHIS2_BOT_APPHUB_TOKEN}}
CI: true
build_exists: false

jobs:
release:
runs-on: ubuntu-latest
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:
Expand All @@ -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:
Expand All @@ -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/[email protected]

- 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/[email protected]
with:
Expand Down

0 comments on commit f8773c5

Please sign in to comment.