Skip to content

Commit ba527e4

Browse files
authored
Merge pull request #48 from getsentry/chore/gha-deprecations
2 parents 46fe875 + fa3bf65 commit ba527e4

File tree

2 files changed

+15
-19
lines changed

2 files changed

+15
-19
lines changed

.github/workflows/updater.yml

Lines changed: 10 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
runs-on: ubuntu-latest
6969
steps:
7070
- 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
7272
with:
7373
access_token: ${{ github.token }}
7474

@@ -128,19 +128,18 @@ jobs:
128128
id: root
129129
run: |
130130
$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"
133131
$prBranch = switch ('${{ inputs.pr-strategy }}')
134132
{
135133
'create' { 'deps/${{ inputs.path }}/${{ steps.target.outputs.latestTag }}' }
136134
'update' { 'deps/${{ inputs.path }}' }
137135
default { throw "Unkown PR strategy '${{ inputs.pr-strategy }}'." }
138136
}
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
140139
141140
- name: Fetch an existing PR
142141
if: steps.target.outputs.latestTag != steps.target.outputs.originalTag
143-
uses: octokit/request-action@971ad48f9c40ed001c41c2671b1e6e8e8165d5af
142+
uses: octokit/request-action@89a1754fe82ca777b044ca8e79e9881a42f15a93 # v2.1.7
144143
id: existing-pr-request
145144
with:
146145
route: GET /repos/${{ github.repository }}/pulls?base={base}&head={head}
@@ -159,15 +158,14 @@ jobs:
159158
160159
$prCount = $($data | jq '. | length')
161160
162-
Write-Host '::echo::on'
163161
if ($prCount -eq '0')
164162
{
165-
Write-Host "::set-output name=url::"
163+
"url=" | Tee-Object $env:GITHUB_OUTPUT -Append
166164
}
167165
elseif ($prCount -eq '1')
168166
{
169167
$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
171169
}
172170
else
173171
{
@@ -189,7 +187,7 @@ jobs:
189187
# First we create a PR only if it doesn't exist. We will later overwrite the content with the same action.
190188
- name: Create a PR
191189
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
193191
id: create-pr
194192
with:
195193
base: ${{ steps.root.outputs.baseBranch }}
@@ -209,14 +207,13 @@ jobs:
209207
if: steps.target.outputs.latestTag != steps.target.outputs.originalTag
210208
id: pr
211209
run: |
212-
Write-Host '::echo::on'
213210
if ('${{ steps.create-pr.outputs.pull-request-url }}' -ne '')
214211
{
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
216213
}
217214
elseif ('${{ steps.existing-pr.outputs.url }}' -ne '')
218215
{
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
220217
}
221218
else
222219
{
@@ -253,7 +250,7 @@ jobs:
253250
# 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.
254251
- name: Update the PR
255252
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
257254
with:
258255
base: ${{ steps.root.outputs.baseBranch }}
259256
branch: ${{ steps.root.outputs.prBranch }}

updater/scripts/update-dependency.ps1

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -133,12 +133,11 @@ if ("$Tag" -eq "")
133133
$latestTag = $tags[-1]
134134
$latestTagNice = ($latestTag -match "^[0-9]") ? "v$latestTag" : $latestTag
135135

136-
Write-Host '::echo::on'
137-
Write-Host "::set-output name=originalTag::$originalTag"
138-
Write-Host "::set-output name=latestTag::$latestTag"
139-
Write-Host "::set-output name=latestTagNice::$latestTagNice"
140-
Write-Host "::set-output name=url::$url"
141-
Write-Host "::set-output name=mainBranch::$mainBranch"
136+
"originalTag=$originalTag" | Tee-Object $env:GITHUB_OUTPUT -Append
137+
"latestTag=$latestTag" | Tee-Object $env:GITHUB_OUTPUT -Append
138+
"latestTagNice=$latestTagNice" | Tee-Object $env:GITHUB_OUTPUT -Append
139+
"url=$url" | Tee-Object $env:GITHUB_OUTPUT -Append
140+
"mainBranch=$mainBranch" | Tee-Object $env:GITHUB_OUTPUT -Append
142141

143142
if ("$originalTag" -eq "$latestTag")
144143
{

0 commit comments

Comments
 (0)