mirror of
https://github.com/aljazceru/plugins.git
synced 2025-12-24 08:34:18 +01:00
Fix CI workflow main
This commit is contained in:
16
.github/workflows/main.yml
vendored
16
.github/workflows/main.yml
vendored
@@ -96,19 +96,25 @@ jobs:
|
||||
|
||||
plugin_dirs=''
|
||||
|
||||
if [[ ${{ github.event_name }} == 'pull_request' ]]; then
|
||||
if [[ '${{ github.event_name }}' == 'pull_request' ]]
|
||||
then
|
||||
# Fetch and checkout branches to permit the 'git diff' below.
|
||||
git fetch && git checkout ${{ github.base_ref }}
|
||||
|
||||
head_ref='${{ github.head_ref }}'
|
||||
source_repo="${{ github.event.pull_request.head.repo.full_name }}"
|
||||
# Fetch and update local head ref if the source repository is not ours.
|
||||
if [[ $source_repo != ${{ github.repository }} ]]; then
|
||||
git fetch https://github.com/$source_repo.git ${{ github.head_ref }}:${{ github.head_ref }}
|
||||
if [[ "$source_repo" != "${{ github.repository }}" ]]
|
||||
then
|
||||
git remote add other-remote https://github.com/$source_repo
|
||||
git fetch other-remote
|
||||
head_ref="other-remote/${{ github.head_ref }}"
|
||||
else
|
||||
git checkout ${{ github.head_ref }}
|
||||
fi
|
||||
git checkout ${{ github.head_ref }}
|
||||
|
||||
# Collect the plugins that have changed.
|
||||
plugin_dirs=$(git diff --name-only ${{ github.base_ref }} ${{ github.head_ref }} \
|
||||
plugin_dirs=$(git diff --name-only ${{ github.base_ref }} $head_ref \
|
||||
| cut -d '/' -f1 \
|
||||
| grep -v '^\.' \
|
||||
| grep -v 'archived' \
|
||||
|
||||
Reference in New Issue
Block a user