Skip to content

Commit

Permalink
refactor: use run step condition (#55)
Browse files Browse the repository at this point in the history
* 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
  • Loading branch information
LayZeeDK authored Sep 1, 2022
1 parent 837dc32 commit eae3c65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
10 changes: 4 additions & 6 deletions action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -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": {
Expand Down

0 comments on commit eae3c65

Please sign in to comment.