Skip to content

Commit

Permalink
fix: fetch main before checking diff
Browse files Browse the repository at this point in the history
  • Loading branch information
henrylee97 committed Nov 8, 2023
1 parent 48061e7 commit 9224215
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions .github/workflows/check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,10 @@ jobs:

steps:
- uses: actions/checkout@v4
with:
ref: ${{ github.base_ref }}
- uses: actions/checkout@v4
with:
ref: ${{ github.head_ref }}
- id: find-targets
run: |
projects=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} | grep -e "^OCaml/" -e "^Java/" -e "^C/" -e "^Solidity/" | cut -d '/' -f 1-2 | sort | uniq | xargs -I{prj} echo \"{prj}\" | tr '\n' ',' | sed 's/,*$//')
git fetch origin ${{ github.base_ref }}:refs/remotes/origin/${{ github.base_ref }}
projects=$(git diff --name-only origin/${{ github.base_ref }} ${{ github.head_ref }} | grep -e "^OCaml/" -e "^Java/" -e "^C/" -e "^Solidity/" | cut -d '/' -f 1-2 | sort | uniq | xargs -I{prj} echo \"{prj}\" | tr '\n' ',' | sed 's/,*$//')
echo "targets=[$projects]" >> ${GITHUB_OUTPUT}
outputs:
Expand Down

0 comments on commit 9224215

Please sign in to comment.