68
68
runs-on : ubuntu-latest
69
69
steps :
70
70
- name : Cancel Previous Runs
71
- uses : styfle/cancel-workflow-action@a40b8845c0683271d9f53dfcb887a7e181d3918b # Tag: 0.9.1
71
+ uses : styfle/cancel-workflow-action@b173b6ec0100793626c2d9e6b90435061f4fc3e5 # Tag: 0.11.0
72
72
with :
73
73
access_token : ${{ github.token }}
74
74
@@ -128,19 +128,18 @@ jobs:
128
128
id : root
129
129
run : |
130
130
$mainBranch = $(git remote show origin | Select-String "HEAD branch: (.*)").Matches[0].Groups[1].Value
131
- Write-Host '::echo::on'
132
- Write-Host "::set-output name=baseBranch::$mainBranch"
133
131
$prBranch = switch ('${{ inputs.pr-strategy }}')
134
132
{
135
133
'create' { 'deps/${{ inputs.path }}/${{ steps.target.outputs.latestTag }}' }
136
134
'update' { 'deps/${{ inputs.path }}' }
137
135
default { throw "Unkown PR strategy '${{ inputs.pr-strategy }}'." }
138
136
}
139
- Write-Host "::set-output name=prBranch::$prBranch"
137
+ "baseBranch=$mainBranch" | Tee-Object $env:GITHUB_OUTPUT -Append
138
+ "prBranch=$prBranch" | Tee-Object $env:GITHUB_OUTPUT -Append
140
139
141
140
- name : Fetch an existing PR
142
141
if : steps.target.outputs.latestTag != steps.target.outputs.originalTag
143
- uses : octokit/request-action@971ad48f9c40ed001c41c2671b1e6e8e8165d5af
142
+ uses : octokit/request-action@89a1754fe82ca777b044ca8e79e9881a42f15a93 # v2.1.7
144
143
id : existing-pr-request
145
144
with :
146
145
route : GET /repos/${{ github.repository }}/pulls?base={base}&head={head}
@@ -159,15 +158,14 @@ jobs:
159
158
160
159
$prCount = $($data | jq '. | length')
161
160
162
- Write-Host '::echo::on'
163
161
if ($prCount -eq '0')
164
162
{
165
- Write-Host "::set-output name=url::"
163
+ "url=" | Tee-Object $env:GITHUB_OUTPUT -Append
166
164
}
167
165
elseif ($prCount -eq '1')
168
166
{
169
167
$url = $($data | Select-String '"html_url": +"(.*/pull/.*)"').Matches[0].Groups[1].Value
170
- Write-Host "::set-output name= url:: $url"
168
+ " url= $url" | Tee-Object $env:GITHUB_OUTPUT -Append
171
169
}
172
170
else
173
171
{
@@ -189,7 +187,7 @@ jobs:
189
187
# First we create a PR only if it doesn't exist. We will later overwrite the content with the same action.
190
188
- name : Create a PR
191
189
if : ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.existing-pr.outputs.url == '') }}
192
- uses : peter-evans/create-pull-request@f22a7da129c901513876a2380e2dae9f8e145330
190
+ uses : peter-evans/create-pull-request@b4d51739f96fca8047ad065eccef63442d8e99f7 # pin#v4
193
191
id : create-pr
194
192
with :
195
193
base : ${{ steps.root.outputs.baseBranch }}
@@ -209,14 +207,13 @@ jobs:
209
207
if : steps.target.outputs.latestTag != steps.target.outputs.originalTag
210
208
id : pr
211
209
run : |
212
- Write-Host '::echo::on'
213
210
if ('${{ steps.create-pr.outputs.pull-request-url }}' -ne '')
214
211
{
215
- Write-Host "::set-output name= url:: ${{ steps.create-pr.outputs.pull-request-url }}"
212
+ " url= ${{ steps.create-pr.outputs.pull-request-url }}" | Tee-Object $env:GITHUB_OUTPUT -Append
216
213
}
217
214
elseif ('${{ steps.existing-pr.outputs.url }}' -ne '')
218
215
{
219
- Write-Host "::set-output name= url:: ${{ steps.existing-pr.outputs.url }}"
216
+ " url= ${{ steps.existing-pr.outputs.url }}" | Tee-Object $env:GITHUB_OUTPUT -Append
220
217
}
221
218
else
222
219
{
@@ -253,7 +250,7 @@ jobs:
253
250
# Now make the PR in its final state. This way we only have one commit and no updates if there are no changes between runs.
254
251
- name : Update the PR
255
252
if : steps.target.outputs.latestTag != steps.target.outputs.originalTag
256
- uses : peter-evans/create-pull-request@f22a7da129c901513876a2380e2dae9f8e145330
253
+ uses : peter-evans/create-pull-request@b4d51739f96fca8047ad065eccef63442d8e99f7
257
254
with :
258
255
base : ${{ steps.root.outputs.baseBranch }}
259
256
branch : ${{ steps.root.outputs.prBranch }}
0 commit comments