Skip to content

Commit

Permalink
Update php.yml
Browse files Browse the repository at this point in the history
Signed-off-by: ArchBlood <[email protected]>
  • Loading branch information
ArchBlood authored Oct 25, 2024
1 parent 14d6351 commit eeea585
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions .github/workflows/php.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,10 +13,9 @@ jobs:
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.head_ref }}
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}

- name: Setup PHP
uses: shivammathur/[email protected]
with:
Expand All @@ -28,12 +27,15 @@ jobs:
echo "Head ref: ${{ github.head_ref }}"
echo "Base ref: ${{ github.base_ref }}"
- name: Fetch all branches
run: git fetch --all

- name: Check for composer.json changes
id: check-changes
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.event.pull_request.base.ref }}
git --no-pager diff --name-only origin/${{ github.event.pull_request.base.ref }} HEAD | grep -q "composer.json" && echo "changed=true" >> $GITHUB_OUTPUT || echo "changed=false" >> $GITHUB_OUTPUT
BASE_BRANCH=${{ github.event.pull_request.base.ref }}
git diff --name-only origin/$BASE_BRANCH HEAD | grep -q "^composer.json$" && echo "changed=true" >> $GITHUB_OUTPUT || echo "changed=false" >> $GITHUB_OUTPUT
- name: Cache Composer packages
id: composer-cache
Expand Down

0 comments on commit eeea585

Please sign in to comment.