Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 7 additions & 2 deletions .github/workflows/toc-generator_push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,10 +15,15 @@ jobs:
steps:
- name: Check if ref is not default branch
run: |
target_branch="${{ github.ref }}"
if [ "${{ github.event_name }}" == "pull_request" ]; then
target_branch="${{ github.event.pull_request.base.ref }}"
else
target_branch=$(echo "${{ github.ref }}" | sed 's|refs/heads/||')
fi

default_branch="${{ github.event.repository.default_branch }}"

if [[ "$target_branch" != "refs/heads/$default_branch" ]]; then
if [[ "$target_branch" != "$default_branch" ]]; then
echo "::notice::This is not the default branch. ($default_branch)"
echo "Target branch: $target_branch"
echo "Default branch: $default_branch"
Expand Down
Loading