File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -360,6 +360,7 @@ jobs:
360360 }
361361 }
362362 EventPath : ${{ runner.temp }}/fake-event.json
363+ EventJson : ' {"pull_request":{"head":{"ref":"feat/test-ignore"},"labels":[{"name":"patch"},{"name":"skip-release"}]}}'
363364
364365 - name : Verify - Ignore label
365366 shell : pwsh
Original file line number Diff line number Diff line change @@ -35,6 +35,10 @@ inputs:
3535 description : Path to the GitHub event JSON file. Defaults to the standard GitHub event path. Override for testing.
3636 required : false
3737 default : ' '
38+ EventJson :
39+ description : GitHub event payload as a JSON string. When set, overrides reading from the event file. Use for testing.
40+ required : false
41+ default : ' '
3842
3943outputs :
4044 Version :
7175 env :
7276 PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_Settings : ${{ inputs.Settings }}
7377 PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_Name : ${{ inputs.Name }}
78+ PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_EventJson : ${{ inputs.EventJson }}
7479 PSMODULE_ACTION_PATH : ${{ github.action_path }}
7580 GITHUB_EVENT_PATH : ${{ inputs.EventPath || github.event_path }}
7681 run : |
Original file line number Diff line number Diff line change @@ -59,8 +59,13 @@ LogGroup 'Resolve configuration' {
5959}
6060
6161LogGroup ' Event information' {
62- $githubEventJson = Get-Content $env: GITHUB_EVENT_PATH
63- $githubEvent = $githubEventJson | ConvertFrom-Json
62+ $eventJsonInput = $env: PSMODULE_RESOLVE_PSMODULEVERSION_INPUT_EventJson
63+ if (-not [string ]::IsNullOrWhiteSpace($eventJsonInput )) {
64+ $githubEvent = $eventJsonInput | ConvertFrom-Json
65+ } else {
66+ $githubEventJson = Get-Content $env: GITHUB_EVENT_PATH
67+ $githubEvent = $githubEventJson | ConvertFrom-Json
68+ }
6469 $pull_request = $githubEvent.pull_request
6570 if (-not $pull_request ) {
6671 throw ' GitHub event does not contain pull_request data. This action must be run from a pull_request event.'
You can’t perform that action at this time.
0 commit comments