Skip to content

Commit

Permalink
ci: testing base ref in git actions
Browse files Browse the repository at this point in the history
  • Loading branch information
nishaq503 committed Jan 25, 2024
1 parent 55c9624 commit d15cb6a
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion .github/workflows/package-filter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,16 @@ jobs:
run: |
PACKAGE_DIRS=""
for changed_file in $(git diff --name-only origin/${{ github.base_ref }}...)
# echo the base ref
base_ref=${{ github.base_ref }}
if [[ -z "$base_ref" ]]
then
base_ref="master"
echo "::warning::Action not running on PR, defaulting to base branch to master"
fi
echo "The base ref is $base_ref"
for changed_file in $(git diff --name-only origin/${base_ref}...)
do
pkg_dir=$(dirname ${changed_file})
Expand Down

0 comments on commit d15cb6a

Please sign in to comment.