Skip to content

Commit f8b3e81

Browse files
committed
fix: set working directory to caller-repo for all relevant steps in the updater action
1 parent 0d65bdf commit f8b3e81

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

updater/action.yml

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,10 +104,12 @@ runs:
104104
with:
105105
token: ${{ inputs.api-token }}
106106
ref: ${{ inputs.target-branch || github.ref }}
107+
path: caller-repo
107108

108109
- name: Update to the latest version
109110
id: target
110111
shell: pwsh
112+
working-directory: caller-repo
111113
env:
112114
DEPENDENCY_PATH: ${{ inputs.path }}
113115
DEPENDENCY_PATTERN: ${{ inputs.pattern }}
@@ -119,6 +121,7 @@ runs:
119121
if: steps.target.outputs.latestTag != steps.target.outputs.originalTag
120122
id: root
121123
shell: pwsh
124+
working-directory: caller-repo
122125
env:
123126
PR_STRATEGY: ${{ inputs.pr-strategy }}
124127
DEPENDENCY_PATH: ${{ inputs.path }}
@@ -149,9 +152,10 @@ runs:
149152
- name: Parse the existing PR URL
150153
if: ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.root.outputs.changed == 'false') }}
151154
id: existing-pr
155+
shell: pwsh
156+
working-directory: caller-repo
152157
env:
153158
GH_TOKEN: ${{ inputs.api-token }}
154-
shell: pwsh
155159
run: |
156160
$urls = @(gh api 'repos/${{ github.repository }}/pulls?base=${{ steps.root.outputs.baseBranch }}&head=${{ github.repository_owner }}:${{ steps.root.outputs.prBranch }}' --jq '.[].html_url')
157161
if ($urls.Length -eq 0)
@@ -170,11 +174,13 @@ runs:
170174
- name: Show git diff
171175
if: ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.existing-pr.outputs.url == '') && ( steps.root.outputs.changed == 'false') }}
172176
shell: bash
177+
working-directory: caller-repo
173178
run: git --no-pager diff
174179

175180
- name: Get target changelog
176181
if: ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.root.outputs.changed == 'false') }}
177182
shell: pwsh
183+
working-directory: caller-repo
178184
env:
179185
GH_TOKEN: ${{ inputs.api-token }}
180186
run: |
@@ -189,6 +195,7 @@ runs:
189195
if: ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.existing-pr.outputs.url == '') && ( steps.root.outputs.changed == 'false') }}
190196
uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc # pin#v6.0.1
191197
id: create-pr
198+
working-directory: caller-repo
192199
env:
193200
DEPENDENCY_PATH: ${{ inputs.path }}
194201
DEPENDENCY_NAME: ${{ inputs.name }}
@@ -209,6 +216,7 @@ runs:
209216
if: ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.root.outputs.changed == 'false') }}
210217
id: pr
211218
shell: pwsh
219+
working-directory: caller-repo
212220
run: |
213221
if ('${{ steps.create-pr.outputs.pull-request-url }}' -ne '')
214222
{
@@ -231,10 +239,12 @@ runs:
231239
with:
232240
token: ${{ inputs.api-token }}
233241
ref: ${{ inputs.target-branch || github.ref }}
242+
path: caller-repo
234243

235244
- name: 'After new PR: redo the update'
236245
if: ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.existing-pr.outputs.url == '') && ( steps.root.outputs.changed == 'false') }}
237246
shell: pwsh
247+
working-directory: caller-repo
238248
env:
239249
DEPENDENCY_PATH: ${{ inputs.path }}
240250
GH_TOKEN: ${{ inputs.api-token }}
@@ -243,6 +253,7 @@ runs:
243253
- name: Update Changelog
244254
if: ${{ inputs.changelog-entry && ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.root.outputs.changed == 'false') }}
245255
shell: pwsh
256+
working-directory: caller-repo
246257
env:
247258
DEPENDENCY_NAME: ${{ inputs.name }}
248259
CHANGELOG_SECTION: ${{ inputs.changelog-section }}
@@ -260,13 +271,15 @@ runs:
260271
- name: Show final git diff
261272
if: ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.root.outputs.changed == 'false') }}
262273
shell: bash
274+
working-directory: caller-repo
263275
run: git --no-pager diff
264276

265277
# 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.
266278
- name: Update the PR
267279
if: ${{ ( steps.target.outputs.latestTag != steps.target.outputs.originalTag ) && ( steps.root.outputs.changed == 'false') }}
268280
uses: peter-evans/create-pull-request@a4f52f8033a6168103c2538976c07b467e8163bc # pin#v6.0.1
269281
id: update
282+
working-directory: caller-repo
270283
env:
271284
DEPENDENCY_PATH: ${{ inputs.path }}
272285
DEPENDENCY_NAME: ${{ inputs.name }}

0 commit comments

Comments
 (0)