-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Problem
The Action-Test workflow, which uses the Publish-PSModule action, cannot be reliably triggered or tested using schedule or workflow_dispatch events. When triggered by these events, the workflow fails with the following error from the init.ps1 script:
Exception: /home/runner/work/Publish-PSModule/Publish-PSModule/scripts/init.ps1:82
Line |
82 | throw 'GitHub event does not contain pull_request data. This …
| ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
| GitHub event does not contain pull_request data. This script must be run
| from a pull_request event.
Root Cause
The script expects the workflow to be triggered by a pull_request event and fails when event context is missing, as with scheduled or manual (workflow_dispatch) runs.
Expected Improvement
- Refactor the workflow and/or the Publish-PSModule action to allow tests to be executed using schedule or workflow_dispatch events, e. g.:
- Detect event type and skip PR-only logic when appropriate
- Fall back to mock PR data for testing
- Update docs to clarify which events can be used for testing
References
This issue affects scheduled runs in the Action-Test workflow that use the Publish-PSModule action.
Job context: Publish-PSModule/scripts/init.ps1:82 (ref)
Please investigate and propose a solution to make testability possible from all relevant workflow triggers.
Metadata
Metadata
Assignees
Labels
No labels