Skip to content

Commit

Permalink
Merge pull request #3 from nimjor/fix-printing-version
Browse files Browse the repository at this point in the history
update to support version recent version check syntax
  • Loading branch information
nimjor authored Aug 30, 2024
2 parents 0037b9f + 1337813 commit 515b732
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
10 changes: 9 additions & 1 deletion .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,15 @@ jobs:
# versions pulled from channels other than "stable" may not have a --version flag
if: matrix.inputs.version != 'latest' && matrix.inputs.channel == 'stable'
run: |
[[ "$(crossplane --version)" == "${{ matrix.inputs.version }}" ]] || exit 1
set +e
crossplane version --client &> /dev/null
code=$?
set -e
if [ $code -eq 0 ]; then
[[ "$(crossplane version --client)" == *"${{ matrix.inputs.version }}"* ]] || exit 1
else
[[ "$(crossplane --version)" == *"${{ matrix.inputs.version }}"* ]] || exit 1
fi
ci-status:
name: CI Status
Expand Down
11 changes: 10 additions & 1 deletion action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,15 @@ runs:
curl -sL "https://raw.githubusercontent.com/crossplane/crossplane/master/install.sh" | sh
chmod +x $GITHUB_WORKSPACE/bin/crossplane
echo "Crossplane CLI installed version: $($GITHUB_WORKSPACE/bin/crossplane --version)"
set +e
$GITHUB_WORKSPACE/bin/crossplane version --client &> /dev/null
code=$?
set -e
if [ $code -eq 0 ]; then
echo "Crossplane CLI installed version: $($GITHUB_WORKSPACE/bin/crossplane version --client)"
else
echo "Crossplane CLI installed version: $($GITHUB_WORKSPACE/bin/crossplane --version)"
fi
echo "$GITHUB_WORKSPACE/bin" >> $GITHUB_PATH
echo "$RUNNER_WORKSPACE/$(basename $GITHUB_REPOSITORY)/bin" >> $GITHUB_PATH

0 comments on commit 515b732

Please sign in to comment.