Skip to content

Commit e1d7a8c

Browse files
committed
fix: resolve CI workflow pending issue for release PRs
- Fixed CI workflow conditions to properly handle release PRs created by create-release-pr.yml - Added support for 'doljae' actor in pull_request_target conditions - Added release branch detection (startsWith(github.event.pull_request.head.ref, 'release/')) - Fixed boolean default values in workflow_dispatch inputs - Ensures test and security workflows run on release PRs This resolves the issue where test workflows were stuck in pending state when release PRs were created by the automated workflow.
1 parent 749d692 commit e1d7a8c

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ on:
1515
run_tests:
1616
description: 'Run tests'
1717
required: false
18-
default: 'true'
18+
default: true
1919
type: boolean
2020
run_security:
2121
description: 'Run security scan'
2222
required: false
23-
default: 'true'
23+
default: true
2424
type: boolean
2525

2626
# Add explicit permissions for security features
@@ -43,6 +43,8 @@ jobs:
4343
(
4444
github.actor == 'github-actions[bot]' ||
4545
github.actor == 'dependabot[bot]' ||
46+
github.actor == 'doljae' ||
47+
startsWith(github.event.pull_request.head.ref, 'release/') ||
4648
github.event.pull_request.head.repo.full_name == github.repository
4749
)
4850
) ||
@@ -98,7 +100,22 @@ jobs:
98100
# Only run security scanning on public repositories or when explicitly enabled
99101
if: >
100102
(github.event.repository.private == false || github.event_name == 'schedule') &&
101-
(github.event_name != 'workflow_dispatch' || github.event.inputs.run_security == 'true')
103+
(github.event_name != 'workflow_dispatch' || github.event.inputs.run_security == 'true') &&
104+
(
105+
github.event_name == 'pull_request' ||
106+
(
107+
github.event_name == 'pull_request_target' &&
108+
(
109+
github.actor == 'github-actions[bot]' ||
110+
github.actor == 'dependabot[bot]' ||
111+
github.actor == 'doljae' ||
112+
startsWith(github.event.pull_request.head.ref, 'release/') ||
113+
github.event.pull_request.head.repo.full_name == github.repository
114+
)
115+
) ||
116+
github.event_name == 'push' ||
117+
github.event_name == 'schedule'
118+
)
102119
103120
steps:
104121
- name: Checkout code
@@ -126,7 +143,22 @@ jobs:
126143
runs-on: ubuntu-latest
127144
if: >
128145
github.event.repository.private == true &&
129-
(github.event_name != 'workflow_dispatch' || github.event.inputs.run_security == 'true')
146+
(github.event_name != 'workflow_dispatch' || github.event.inputs.run_security == 'true') &&
147+
(
148+
github.event_name == 'pull_request' ||
149+
(
150+
github.event_name == 'pull_request_target' &&
151+
(
152+
github.actor == 'github-actions[bot]' ||
153+
github.actor == 'dependabot[bot]' ||
154+
github.actor == 'doljae' ||
155+
startsWith(github.event.pull_request.head.ref, 'release/') ||
156+
github.event.pull_request.head.repo.full_name == github.repository
157+
)
158+
) ||
159+
github.event_name == 'push' ||
160+
github.event_name == 'schedule'
161+
)
130162
131163
steps:
132164
- name: Checkout code

0 commit comments

Comments
 (0)