Skip to content

Commit 0fe23cb

Browse files
authored
repo sync
2 parents 8bbccc5 + 176037f commit 0fe23cb

3 files changed

Lines changed: 11 additions & 8 deletions

File tree

.github/workflows/link-check-test.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ on:
77
jobs:
88
see_if_should_skip:
99
continue-on-error: true
10-
runs-on: self-hosted
10+
runs-on: ubuntu-latest
1111
# Map a step output to a job output
1212
outputs:
1313
should_skip: ${{ steps.skip_check.outputs.should_skip }}
@@ -20,7 +20,7 @@ jobs:
2020
paths: '[".github/workflows/link-check-test.yml", "assets/**", "content/**", "data/**", "includes/**", "javascripts/**", "jest-puppeteer.config.js", "jest.config.js", "layouts/**", "lib/**", "middleware/**", "package-lock.json", "package.json", "server.js", "translations/**", "webpack.config.js"]'
2121
build:
2222
needs: see_if_should_skip
23-
runs-on: self-hosted
23+
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
2424
steps:
2525
# Each of these ifs needs to be repeated at each step to make sure the required check still runs
2626
# Even if if doesn't do anything

.github/workflows/test.yml

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,9 @@ jobs:
3131

3232
test:
3333
needs: see_if_should_skip
34-
runs-on: ubuntu-latest
34+
# Run on self-hosted if the private repo or ubuntu-latest if the public repo
35+
# See pull # 17442 in the private repo for context
36+
runs-on: ${{ fromJSON('["ubuntu-latest", "self-hosted"]')[github.repository == 'github/docs-internal'] }}
3537
timeout-minutes: 60
3638
strategy:
3739
fail-fast: false
@@ -72,15 +74,15 @@ jobs:
7274
name: Install dependencies
7375
run: npm ci
7476

75-
- name: Clone early access
76-
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository == 'github/docs-internal' }}
77+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository == 'github/docs-internal' }}
78+
name: Clone early access
7779
run: npm run heroku-postbuild
7880
env:
7981
DOCUBOT_REPO_PAT: ${{ secrets.DOCUBOT_REPO_PAT }}
8082
GIT_BRANCH: ${{ github.ref }}
8183

82-
- name: Run build script
83-
if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository != 'github/docs-internal' }}
84+
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' && github.repository != 'github/docs-internal' }}
85+
name: Run build script
8486
run: npm run build
8587

8688
- if: ${{ needs.see_if_should_skip.outputs.should_skip != 'true' }}

script/early-access/clone-for-build.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ const earlyAccessRepoName = 'docs-early-access'
4949
const earlyAccessDirName = 'early-access'
5050
const earlyAccessFullRepo = `https://${DOCUBOT_REPO_PAT}@github.com/${earlyAccessOwner}/${earlyAccessRepoName}`
5151

52-
const earlyAccessCloningParentDir = os.tmpdir()
52+
// On our Azure self-hosted runners, os.tmpdir() doesn't work reliably. On Heroku, os.homedir doesn't work reliably.
53+
const earlyAccessCloningParentDir = process.env.CI ? os.homedir() : os.tmpdir()
5354
const earlyAccessCloningDir = path.join(earlyAccessCloningParentDir, earlyAccessRepoName)
5455

5556
const destinationDirNames = ['content', 'data', 'assets/images']

0 commit comments

Comments
 (0)