We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents ee4de8c + 5614308 commit 8ff80ccCopy full SHA for 8ff80cc
.github/workflows/toc-generator_push.yaml
@@ -15,10 +15,15 @@ jobs:
15
steps:
16
- name: Check if ref is not default branch
17
run: |
18
- target_branch="${{ github.ref }}"
+ if [ "${{ github.event_name }}" == "pull_request" ]; then
19
+ target_branch="${{ github.event.pull_request.base.ref }}"
20
+ else
21
+ target_branch=$(echo "${{ github.ref }}" | sed 's|refs/heads/||')
22
+ fi
23
+
24
default_branch="${{ github.event.repository.default_branch }}"
25
- if [[ "$target_branch" != "refs/heads/$default_branch" ]]; then
26
+ if [[ "$target_branch" != "$default_branch" ]]; then
27
echo "::notice::This is not the default branch. ($default_branch)"
28
echo "Target branch: $target_branch"
29
echo "Default branch: $default_branch"
0 commit comments