Skip to content

Commit 29850ab

Browse files
author
sangeet-joy_xero
committed
ci: added the compare version step
1 parent b205f6c commit 29850ab

File tree

1 file changed

+16
-1
lines changed

1 file changed

+16
-1
lines changed

.github/workflows/check-publish.yml

+16-1
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ jobs:
2222
run: |
2323
latest_version=$(gh release view --json tagName --jq '.tagName')
2424
echo "Latest release version is - $latest_version"
25-
echo "::set-output name=release_tag::$latest_version"
25+
echo "php_version=${latest_version}" >> $GITHUB_ENV
2626
working-directory: xero-php-oauth2
2727
env:
2828
GH_TOKEN: ${{secrets.GITHUB_TOKEN}}
@@ -33,3 +33,18 @@ jobs:
3333
RESPONSE=$(curl -s https://repo.packagist.org/p2/xeroapi/xero-php-oauth2.json)
3434
LATEST_VERSION=$(echo $RESPONSE | jq -r '.packages["xeroapi/xero-php-oauth2"][0].version')
3535
echo "latest packagist version $LATEST_VERSION"
36+
echo "latest_packagist_version=${LATEST_VERSION}" >> $GITHUB_ENV
37+
38+
- name: Compare versions
39+
id: compare_versions
40+
run: |
41+
if [ "${{env.php_version}}" == "${{env.latest_packagist_version}}" ]; then
42+
echo "Packagist is up-to-date"
43+
echo "packagist_status=success" >> $GITHUB_ENV
44+
else
45+
echo "Packgist is not updated yet"
46+
echo "packagist_status=failure" >> $GITHUB_ENV
47+
48+
# - name: Send slack Notification on Success
49+
# if: ${{ env.packagist_status == 'success' }}
50+
# uses:

0 commit comments

Comments
 (0)