Skip to content

Commit

Permalink
ci: completed the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
sangeet-joy_xero committed Oct 22, 2024
1 parent 579b94f commit 3f8dd5e
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions .github/workflows/check-publish.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
name: Check Packagist Publish

on:
pull_request:
branches:
- master
release:
types: [published]

jobs:
check-publish:
Expand Down Expand Up @@ -32,17 +31,17 @@ jobs:
run: |
RESPONSE=$(curl -s https://repo.packagist.org/p2/xeroapi/xero-php-oauth2.json)
LATEST_VERSION=$(echo $RESPONSE | jq -r '.packages["xeroapi/xero-php-oauth2"][0].version')
echo "latest packagist version $LATEST_VERSION"
echo "latest packagist version: $LATEST_VERSION"
echo "latest_packagist_version=${LATEST_VERSION}" >> $GITHUB_ENV
- name: Compare versions
id: compare_versions
run: |
if false; then
if [ "${{env.php_version}}" == "${{env.latest_packagist_version}}" ]; then
echo "Packagist is up-to-date"
echo "packagist_status=success" >> $GITHUB_ENV
else
echo "Packgist is not updated yet"
echo "Packagist is not updated yet"
echo "packagist_status=failure" >> $GITHUB_ENV
fi
Expand All @@ -59,7 +58,7 @@ jobs:
package_version: ${{env.php_version}}
repo_link: ${{github.server_url}}/${{github.repository}}

- name: Send slack Notification on Success
- name: Send slack Notification on Failure
if: ${{ env.packagist_status == 'failure' }}
uses: ./xero-php-oauth2/.github/actions/notify-slack
with:
Expand All @@ -75,5 +74,5 @@ jobs:
- name: Fail job if status is Failure
if: ${{env.packagist_status == 'failure'}}
run: |
echo "Job failed because packgist is not updated"
echo "Job failed because packagist is not updated"
exit 1

0 comments on commit 3f8dd5e

Please sign in to comment.