Skip to content

Commit 77e0557

Browse files
committed
BUG: Workaround GitHub app token expiration by explicitly setting push url
This address the following error reported after the built completes when running the "Rebase onto origin/main before push" step. ``` fatal: could not read Username for 'https://github.com': No such device or address ```
1 parent e8ff027 commit 77e0557

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

.github/workflows/build-and-publish.yml

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
repository: Slicer/SlicerDocker
7272
path: SlicerDocker
7373
fetch-depth: 0
74-
token: ${{ steps.app-token.outputs.token }}
74+
persist-credentials: false
7575

7676
- name: Update SlicerDocker and commit changes (if any)
7777
id: update-slicerdocker
@@ -124,6 +124,14 @@ jobs:
124124
# Only rebase & push when the repo actually changed.
125125
# NOTE: We DO NOT push on `force_build` because the intent is to rebuild/publish
126126

127+
- name: Prepare push credentials for SlicerDocker
128+
if: steps.update-slicerdocker.outputs.updated == 'true'
129+
working-directory: SlicerDocker
130+
env:
131+
APP_TOKEN: ${{ steps.app-token.outputs.token }}
132+
run: |
133+
git remote set-url origin https://x-access-token:${APP_TOKEN}@github.com/Slicer/SlicerDocker.git
134+
127135
- name: Rebase onto origin/main before push
128136
if: steps.update-slicerdocker.outputs.updated == 'true'
129137
working-directory: SlicerDocker

0 commit comments

Comments
 (0)