-
Notifications
You must be signed in to change notification settings - Fork 0
Allow Action-Test workflow to run from schedule and workflow_dispatch events #268
Copy link
Copy link
Open
Labels
Description
Context
The Action-Test workflow is used to test actions like Publish-PSModule in CI. Currently, the workflow can only be triggered by pull_request events because the underlying init script expects PR context data.
Request
When the Action-Test workflow is triggered via schedule or workflow_dispatch events, it fails with:
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.
This prevents scheduled regression testing and manual test runs.
What is expected
The workflow and underlying actions should support execution from schedule and workflow_dispatch events in addition to pull_request. When PR context is unavailable, the action should either skip PR-specific logic or use sensible defaults.
Acceptance criteria
- The Action-Test workflow can be triggered via
schedulewithout errors - The Action-Test workflow can be triggered via
workflow_dispatchwithout errors - PR-specific logic is skipped or uses defaults when PR context is unavailable
- Existing
pull_request-triggered behavior is unchanged
Technical decisions
To be determined during implementation planning.
Implementation plan
- Identify all locations in
Publish-PSModule/scripts/init.ps1and related scripts that assumepull_requestevent context - Add event type detection to conditionally handle missing PR data
- Define default/fallback behavior for non-PR triggers (e.g., skip PR comments, use HEAD branch)
- Update the Action-Test workflow to include
scheduleandworkflow_dispatchtriggers - Test the workflow under all three trigger types
Reactions are currently unavailable