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
schedule without errors
- The Action-Test workflow can be triggered via
workflow_dispatch without 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
Context
The Action-Test workflow is used to test actions like Publish-PSModule in CI. Currently, the workflow can only be triggered by
pull_requestevents because the underlying init script expects PR context data.Request
When the Action-Test workflow is triggered via
scheduleorworkflow_dispatchevents, it fails with:This prevents scheduled regression testing and manual test runs.
What is expected
The workflow and underlying actions should support execution from
scheduleandworkflow_dispatchevents in addition topull_request. When PR context is unavailable, the action should either skip PR-specific logic or use sensible defaults.Acceptance criteria
schedulewithout errorsworkflow_dispatchwithout errorspull_request-triggered behavior is unchangedTechnical decisions
To be determined during implementation planning.
Implementation plan
Publish-PSModule/scripts/init.ps1and related scripts that assumepull_requestevent contextscheduleandworkflow_dispatchtriggers