Skip to content

Commit 98e9053

Browse files
committed
ci: allow workflow_dispatch to trigger development publish
When manually triggering CI on a non-main branch, also run the development publish step. Uses github.ref_name as fallback for HEAD_REF since github.head_ref is empty in workflow_dispatch.
1 parent 9012a07 commit 98e9053

1 file changed

Lines changed: 5 additions & 2 deletions

File tree

.github/workflows/ci.yml

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -96,9 +96,12 @@ jobs:
9696
run: pnpm run build
9797

9898
- name: Publish (development)
99-
if: github.repository == 'RightCapitalHQ/phpdoc-parser' && github.base_ref == github.event.repository.default_branch
99+
if: >-
100+
github.repository == 'RightCapitalHQ/phpdoc-parser' &&
101+
(github.base_ref == github.event.repository.default_branch ||
102+
(github.event_name == 'workflow_dispatch' && github.ref_name != github.event.repository.default_branch))
100103
env:
101-
HEAD_REF: ${{ github.head_ref }}
104+
HEAD_REF: ${{ github.head_ref || github.ref_name }}
102105
run: |
103106
preid="${HEAD_REF//\//-}".${{ github.run_number }}.${{ github.run_attempt }}
104107
npm --no-git-tag-version version prerelease --preid="${preid}"

0 commit comments

Comments
 (0)