From eae3c656f8ec9ab22bb442f0f30768663ab611ea Mon Sep 17 00:00:00 2001 From: Lars Gyrup Brink Nielsen Date: Thu, 1 Sep 2022 11:09:44 +0200 Subject: [PATCH] refactor: use run step condition (#55) * refactor: use run step condition Composite run steps have had support for conditions [since November 9th, 2021](https://github.blog/changelog/2021-11-09-github-actions-conditional-execution-of-steps-in-actions/). * chore: bump patch version --- action.yml | 10 ++++------ package.json | 2 +- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/action.yml b/action.yml index f30a595..ad73af3 100644 --- a/action.yml +++ b/action.yml @@ -51,13 +51,11 @@ runs: - name: Optionally set the derived SHAs as NX_BASE and NX_HEAD environment variables for the current job shell: bash + if: ${{ inputs.set-environment-variables-for-job == 'true' }} run: | - # Built-in Github action conditionals are not supported in composite steps so have to check manually in bash - if [ "${{ inputs.set-environment-variables-for-job }}" = "true" ]; then - echo "NX_BASE=${{ steps.setSHAs.outputs.base }}" >> $GITHUB_ENV - echo "NX_HEAD=${{ steps.setSHAs.outputs.head }}" >> $GITHUB_ENV - echo "NX_BASE and NX_HEAD environment variables have been set for the current Job" - fi + echo "NX_BASE=${{ steps.setSHAs.outputs.base }}" >> $GITHUB_ENV + echo "NX_HEAD=${{ steps.setSHAs.outputs.head }}" >> $GITHUB_ENV + echo "NX_BASE and NX_HEAD environment variables have been set for the current Job" branding: icon: "terminal" color: "blue" diff --git a/package.json b/package.json index ff0a503..7ab2d32 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "private": true, - "version": "2.2.3", + "version": "2.2.4", "license": "MIT", "description": "This package.json is here purely to control the version of the Action, in combination with https://github.com/JamesHenry/publish-shell-action", "scripts": {