-
Notifications
You must be signed in to change notification settings - Fork 61.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
repo sync #1791
Merged
+1,056
−450
Merged
repo sync #1791
Changes from 127 commits
Commits
Show all changes
130 commits
Select commit
Hold shift + click to select a range
d818c9f
restore old hidden docs implementation
sarahs 02308fd
add early-access-test to products.yml
sarahs 247fa66
hide contribution button on hidden docs
sarahs a45c854
activeProducts are neither wip nor hidden
sarahs f40f241
support hidden products, which will just be early-access in practice
sarahs beaf733
hide early-access from public list of products
sarahs e44bef8
Merge branch 'main' of https://github.com/github/docs-internal into h…
sarahs 3170d8c
try heroku prebuild script
sarahs f355a2e
use GITHUB_TOKEN for clone
sarahs 71bfc0d
go back to old access key for testing
sarahs 1a0c41b
testing testing
sarahs 0304ff3
testing testing
sarahs 07d090e
use early-access-test
sarahs d290d40
update middleware and tests around robots.txt exclusions of hidden/EA…
sarahs f4e05b1
exclude hidden products in addition to hidden pages from Algolia
sarahs 4341a92
Merge branch 'main' of https://github.com/github/docs-internal into h…
sarahs 129641c
add separate clone script to be run as heroku-prebuild script or loca…
sarahs d7be84f
Merge branch 'main' of https://github.com/github/docs-internal into h…
sarahs 896db3d
comment out branch check for now
sarahs 822649f
add yml config file for setting the EA branch
sarahs 16f9fc7
use the new yml config file for setting the EA branch
sarahs ea9b161
change GITHUB_DOCUBOT_REPO_PAT to DOCUBOT_REPO_PAT
sarahs a36c112
test for presence of content/early-access dir
sarahs e94e4b7
clone early-access repo during testing
sarahs b020382
empty commit
sarahs cad55f5
set staging branch back to main
sarahs 1e9a319
conditional test of early access in actions only
sarahs 24a281a
run clone script from docs-internal only
sarahs df545e8
update var refs in script
sarahs dc50c74
Merge branch 'main' of https://github.com/github/docs-internal into h…
sarahs 472a9d2
Merge branch 'main' of https://github.com/github/docs-internal into h…
sarahs fc33985
Merge branch 'main' into hidden-docs-alt
sarahs 63e3f91
Merge branch 'main' of https://github.com/github/docs-internal into h…
sarahs 271923e
Merge branch 'hidden-docs-alt' of https://github.com/github/docs-inte…
sarahs 67466e8
duplicate change between lint and test steps
sarahs 521d11b
Merge branch 'main' into hidden-docs-alt
JamesMGreene 04e9656
Use Heroku postbuild so the dependencies are installed before cloning…
JamesMGreene 9720574
Add a username to the Git repo string for more completeness
JamesMGreene 850c11a
Fix workflow syntax error
JamesMGreene c6980ab
Fix the other workflow syntax error I missed
JamesMGreene 3008ad1
Update all heroku-prebuild refs to heroku-postbuild
JamesMGreene 3e09715
Add debugging log to cloning script
JamesMGreene 1ea1396
Split debugging statement
JamesMGreene 7514a54
Remove EA cloning from lint -- no JS files in there to lint
JamesMGreene d00f437
Remove debugging statements
JamesMGreene 105bf42
Try removing the x-access-token username from the Git URL
JamesMGreene da7afd4
Manually override GitHub Actions extraHeader
JamesMGreene e913c26
Try ONLY clearing out the extraHeader value rather than overwriting it
JamesMGreene 8b8d6d2
Merge branch 'main' into hidden-docs-alt
heiskr 0cf94f2
Merge branch 'main' of https://github.com/github/docs-internal into h…
sarahs c4b5018
update docs path in newly added robots test
sarahs 089e99b
Merge branch 'main' into hidden-docs-alt
sarahs 2be96ed
Try using actions/checkout's persist-credentials input instead of man…
JamesMGreene 4868f97
Explicitly add 'npm run build' to the 'heroku-postbuild' script as th…
JamesMGreene ed3baeb
Update to use new github/docs-early-access repo
JamesMGreene f410fd1
Mostly reverting github/docs-internal#15313
JamesMGreene e1f3f64
Merge branch 'main' into hidden-docs-alt
JamesMGreene 81fda0e
Cloning script refinements and future planning
JamesMGreene 2c030a8
Remove early-access from the sorted product ID list???
JamesMGreene 4fac3de
Comment out premature tests
JamesMGreene 3e0d94e
Fix pathing on CrowdIn config tests
JamesMGreene bdb859f
Be consistent about paths in CrowdIn config
JamesMGreene bc3131b
Remove old '/early-access' redirect from API Previews page
JamesMGreene 10b9000
Add early-access back in as a product
JamesMGreene 6940bc3
Sort hidden page listing by relativePath
JamesMGreene b75cb10
Make Early Access tests only run on the docs-internal repo
JamesMGreene dac5bc7
Don't re-run build for Actions in the internal repo
JamesMGreene 5b6d704
Rename clone-early-access script
JamesMGreene 050ff6d
Update for early-access under assets/images/
JamesMGreene 1b3af6e
Add Early Access context via middleware to show list of pages
JamesMGreene 287ee20
EA context middleware cleanup
JamesMGreene fc91756
Add script to symlink to local early-access repo
JamesMGreene af3a7f3
Remove unused require in script
JamesMGreene 272c472
Add new content-linting tests for Early Access
JamesMGreene dc36bd8
Change one old API Previews link to use a different redirect URL with…
JamesMGreene 53910e2
Changes to handle a symlink Early Access environment
JamesMGreene 1a732ea
Let's 404 the /early-access page outside of local rather than 403-ing
JamesMGreene 510a0e3
Add test to verify Early Access does not show up as a product in the …
JamesMGreene dd02bfa
Merge main
heiskr bfb4a0d
Update package-lock.json
heiskr 367685b
Update symlinking script to support unlinking
JamesMGreene 5c6f5bb
Fix site-data-references tests by using uniqWith instead of uniqBy
JamesMGreene a53255c
Add tests for site-data-references within article metadata
JamesMGreene 88a889a
Ensure early-access site-data-references are detected by the tests
JamesMGreene 04dff85
Include other actions-only EA-cloning tests now
JamesMGreene 890e86c
Merge branch 'main' into hidden-docs-alt
heiskr 909db6f
Update EA cloning script to rely on the current git branch
JamesMGreene 4962f91
Fix test workflow file
JamesMGreene 1280f6f
Fix rendering tests for /early-access
JamesMGreene b04f01d
Ignore early-access as a product for the category-pages tests?
JamesMGreene 72d1265
Fix lint-files tests for Early Access to use newly established pattern
JamesMGreene d402a60
Merge branch 'main' into hidden-docs-alt
JamesMGreene d6fcc36
Render the nice 404 page for /early-access in non-local envs
JamesMGreene b244d44
Merge branch 'main' of github.com:github/docs-internal into hidden-do…
sarahs 6304c86
lint
sarahs 93a9d3b
add new script
sarahs 6214ee0
be careful of paths for cross-platform use
sarahs e49914f
render early access links for the current version on the landing page
sarahs 5248fac
chmod a+x script/early-access/symlink-from-local-repo.js
sarahs 7757617
move early-access link middleware to contextualizers
sarahs 6d82e46
lint
sarahs d3d2f08
new script to update data and image paths
sarahs 7628caa
Merge branch 'main' of github.com:github/docs-internal into hidden-do…
sarahs 5b49fdf
do not link to early access landing page in sidebar and breadcrumbs
sarahs 2ad6101
show link titles and sort alphabetically
sarahs 98e567a
add message when there are no links for a version
sarahs 3f64bb1
Merge branch 'main' of github.com:github/docs-internal into hidden-do…
sarahs 1258092
Merge branch 'main' of github.com:github/docs-internal into hidden-do…
sarahs 7b9ae59
update script readmes
sarahs f5fc721
do not show header notifications on 404 page
sarahs 1b051af
Merge branch 'main' of github.com:github/docs-internal into hidden-do…
sarahs c206ec5
redeploy to staging
sarahs a8e0ec4
add option to run script on provided path
sarahs fb791ff
repo sync
Octomerger 2f10991
Merge branch 'main' of github.com:github/docs-internal into hidden-do…
sarahs 75fd006
Close unwanted pull requests (#16679)
heiskr 11d8e41
Check repository references (#16680)
heiskr 82644ef
Merge branch 'main' of github.com:github/docs-internal into hidden-do…
sarahs 52301f3
add clarifying comments about how we derive data filepaths from data …
sarahs bf61f53
lint
sarahs ae9956c
add slashes to data paths for consistency with other paths
sarahs b46e881
properly concat versioned hidden product hrefs
sarahs ca39999
update hidden page expectations
sarahs 0ae3d35
Merge pull request #16143 from github/hidden-docs-alt
sarahs c583392
add comment
sarahs 44ccfc2
Merge pull request #16745 from github/hidden-docs-alt-followup
sarahs 30cdb31
Allow repo sync in public repo (#16746)
heiskr c7870f4
Skip EA articles test temporarily (#16748)
JamesMGreene 218d08f
Branch was updated using the 'autoupdate branch' Actions workflow.
Octomerger 25eeefb
repo sync
Octomerger File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,3 @@ | ||
ALGOLIA_API_KEY= | ||
ALGOLIA_APPLICATION_ID= | ||
ALLOW_TRANSLATION_COMMITS= | ||
EARLY_ACCESS_HOSTNAME= | ||
EARLY_ACCESS_SHARED_SECRET= | ||
GITHUB_TOKEN= |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
name: Close unwanted pull requests | ||
on: | ||
pull_request: | ||
paths: | ||
- '.github/workflows/**' | ||
- '.github/CODEOWNERS' | ||
- 'translations/**' | ||
- 'assets/fonts/**' | ||
- 'data/graphql/**' | ||
- 'lib/graphql/**' | ||
- 'lib/redirects/**' | ||
- 'lib/webhooks/**' | ||
jobs: | ||
close_unwanted_pull_requests: | ||
if: github.repository == 'github/docs' && github.event.pull_request.user.login != 'Octomerger' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/github-script@626af12fe9a53dc2972b48385e7fe7dec79145c9 | ||
with: | ||
script: | | ||
await github.issues.createComment({ | ||
...context.repo, | ||
issue_number: context.payload.pull_request.number, | ||
body: | ||
`Thanks for contributing! We do not accept community changes to these files at this time. | ||
- '.github/workflows/**' | ||
- '.github/CODEOWNERS' | ||
- 'translations/**' | ||
- 'assets/fonts/**' | ||
- 'data/graphql/**' | ||
- 'lib/graphql/**' | ||
- 'lib/redirects/**' | ||
- 'lib/webhooks/**'` | ||
}) | ||
await github.issues.update({ | ||
...context.repo, | ||
issue_number: context.payload.pull_request.number, | ||
state: 'closed' | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,17 @@ | ||
.algolia-cache | ||
.DS_Store | ||
.env | ||
node_modules | ||
/node_modules/ | ||
npm-debug.log | ||
coverage | ||
coverage/ | ||
.linkinator | ||
broken_links.md | ||
/assets/images/early-access | ||
/content/early-access | ||
/data/early-access | ||
dist | ||
|
||
# blc: broken link checker | ||
blc_output.log | ||
blc_output_internal.log | ||
/dist/ | ||
broken_links.md |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +0,0 @@ | ||
## Importing Aftermarket Octicons | ||
|
||
#### Background | ||
Some octicons are missing from the project's current version of the `octicons` gem. Because this project is being replaced soon and updating `octicons` would require [significant changes](https://github.com/github/docs-internal/issues/6250#issuecomment-339730405), new octicons should be added manually as needed, via the following process: | ||
|
||
#### How to add | ||
|
||
1. Locate the missing octicon `.svg` in [primer/octions](https://github.com/primer/octicons/tree/master/lib/svg) and download it to your local `app/assets/images/octions` folder | ||
1. Add a line to `app/assets/stylesheets/shared/_octicons.scss` for the new octicon, like so: | ||
```apple css | ||
.octicon-<YOUR OCTICON NAME>:before { | ||
content: url("#{$new-octicons-path}/<YOUR OCTICON FILENAME>.svg") | ||
} | ||
``` | ||
|
||
You may now use the new octicon in your content as normal! :tada: | ||
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
1. From the application server, navigate to the latest release of {% data variables.product.prodname_insights %} on the [Releases page](https://github.com/github/insights-releases/releases/latest) for `github/insights-releases`. | ||
1. From the application server, navigate to the latest release of {% data variables.product.prodname_insights %} on the Releases page for `github/insights-releases`. | ||
2. To download the latest release, under "Assets", click `insights-VERSION.tar.gz`. | ||
 | ||
3. Unzip the directory. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,10 @@ | ||
<nav class="breadcrumbs f5" aria-label="Breadcrumb"> | ||
{% for breadcrumb in breadcrumbs %} | ||
{% if page.hidden %} | ||
<span class="d-inline-block">{{breadcrumb[1].title}}</span> | ||
{% else %} | ||
<a title="{{ breadcrumb[0]}}: {{breadcrumb[1].title}}" href="/{{currentLanguage}}{{breadcrumb[1].href}}" class="d-inline-block {% if breadcrumb[1].href == currentPathWithoutLanguage %}text-gray-light{% endif %}"> | ||
{{breadcrumb[1].title}}</a> | ||
{% endif %} | ||
{% endfor %} | ||
</nav> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
module.exports = function earlyAccessContext (req, res, next) { | ||
if (process.env.NODE_ENV === 'production') { | ||
return next(404) | ||
} | ||
|
||
// Get a list of all hidden pages per version | ||
const earlyAccessPageLinks = req.context.pages | ||
.filter(page => page.hidden) | ||
// Do not include early access landing page | ||
.filter(page => page.relativePath !== 'early-access/index.md') | ||
// Create Markdown links | ||
.map(page => { | ||
return page.permalinks.map(permalink => `- [${permalink.title}](${permalink.href})`) | ||
}) | ||
.flat() | ||
// Get links for the current version | ||
.filter(link => link.includes(req.context.currentVersion)) | ||
.sort() | ||
|
||
// Add to the rendering context | ||
// This is only used in the separate EA repo on local development | ||
req.context.earlyAccessPageLinks = earlyAccessPageLinks.length | ||
? earlyAccessPageLinks.join('\n') | ||
: '_None for this version!_' | ||
|
||
return next() | ||
} |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,130 @@ | ||
#!/usr/bin/env node | ||
|
||
// [start-readme] | ||
// | ||
// This script is run as a postbuild script during staging and deployments on Heroku. It clones a branch | ||
// in the early-access repo that matches the current branch in the docs repo; if one can't be found, it | ||
// clones the `main` branch. | ||
// | ||
// [end-readme] | ||
|
||
require('dotenv').config() | ||
const { | ||
DOCUBOT_REPO_PAT, | ||
HEROKU_PRODUCTION_APP, | ||
GIT_BRANCH // Set by the deployer with the name of the docs-internal branch | ||
} = process.env | ||
|
||
// Exit if PAT is not found | ||
if (!DOCUBOT_REPO_PAT) { | ||
console.log('Skipping early access, not authorized') | ||
process.exit(0) | ||
} | ||
|
||
const { execSync } = require('child_process') | ||
const rimraf = require('rimraf').sync | ||
const fs = require('fs') | ||
const path = require('path') | ||
const os = require('os') | ||
const EA_PRODUCTION_BRANCH = 'main' | ||
|
||
// If a branch name is not provided in the environment, attempt to get | ||
// the local branch name; or default to 'main' | ||
let currentBranch = (GIT_BRANCH || '').replace(/^refs\/heads\//, '') | ||
if (!currentBranch) { | ||
try { | ||
currentBranch = execSync('git branch --show-current').toString() | ||
} catch (err) { | ||
// Ignore but log | ||
console.warn('Error checking for local branch:', err.message) | ||
} | ||
} | ||
if (!currentBranch) { | ||
currentBranch = EA_PRODUCTION_BRANCH | ||
} | ||
|
||
// Early Access details | ||
const earlyAccessOwner = 'github' | ||
const earlyAccessRepoName = 'docs-early-access' | ||
const earlyAccessDirName = 'early-access' | ||
const earlyAccessFullRepo = `https://${DOCUBOT_REPO_PAT}@github.com/${earlyAccessOwner}/${earlyAccessRepoName}` | ||
|
||
const earlyAccessCloningParentDir = os.tmpdir() | ||
const earlyAccessCloningDir = path.join(earlyAccessCloningParentDir, earlyAccessRepoName) | ||
|
||
const destinationDirNames = ['content', 'data', 'assets/images'] | ||
const destinationDirsMap = destinationDirNames | ||
.reduce( | ||
(map, dirName) => { | ||
map[dirName] = path.join(process.cwd(), dirName, earlyAccessDirName) | ||
return map | ||
}, | ||
{} | ||
) | ||
|
||
// Production vs. staging environment | ||
// TODO test that this works as expected | ||
const environment = HEROKU_PRODUCTION_APP ? 'production' : 'staging' | ||
|
||
// Early access branch to clone | ||
let earlyAccessBranch = HEROKU_PRODUCTION_APP ? EA_PRODUCTION_BRANCH : currentBranch | ||
|
||
// Confirm that the branch exists in the remote | ||
let branchExists = execSync(`git ls-remote --heads ${earlyAccessFullRepo} ${earlyAccessBranch}`).toString() | ||
|
||
// If the branch did NOT exist, try checking for the default branch instead | ||
if (!branchExists && earlyAccessBranch !== EA_PRODUCTION_BRANCH) { | ||
console.warn(`The branch '${earlyAccessBranch}' was not found in ${earlyAccessOwner}/${earlyAccessRepoName}!`) | ||
console.warn(`Attempting the default branch ${EA_PRODUCTION_BRANCH} instead...`) | ||
|
||
earlyAccessBranch = EA_PRODUCTION_BRANCH | ||
branchExists = execSync(`git ls-remote --heads ${earlyAccessFullRepo} ${earlyAccessBranch}`).toString() | ||
} | ||
|
||
// If no suitable branch was found, bail out now | ||
if (!branchExists) { | ||
console.error(`The branch '${earlyAccessBranch}' was not found in ${earlyAccessOwner}/${earlyAccessRepoName}!`) | ||
console.error('Exiting!') | ||
process.exit(1) | ||
} | ||
|
||
// Remove any previously cloned copies of the early access repo | ||
rimraf(earlyAccessCloningDir) | ||
|
||
// Clone the repo | ||
console.log(`Setting up: ${earlyAccessCloningDir}`) | ||
execSync( | ||
`git clone --single-branch --branch ${earlyAccessBranch} ${earlyAccessFullRepo} ${earlyAccessRepoName}`, | ||
{ | ||
cwd: earlyAccessCloningParentDir | ||
} | ||
) | ||
console.log(`Using early-access ${environment} branch: '${earlyAccessBranch}'`) | ||
|
||
// Remove all existing early access directories from this repo | ||
destinationDirNames.forEach(key => rimraf(destinationDirsMap[key])) | ||
|
||
// Move the latest early access source directories into this repo | ||
destinationDirNames.forEach((dirName) => { | ||
const sourceDir = path.join(earlyAccessCloningDir, dirName) | ||
const destDir = destinationDirsMap[dirName] | ||
|
||
// If the source directory doesn't exist, skip it | ||
if (!fs.existsSync(sourceDir)) { | ||
console.warn(`Early access directory '${dirName}' does not exist. Skipping...`) | ||
return | ||
} | ||
|
||
// Move the directory from the cloned source to the destination | ||
fs.renameSync(sourceDir, destDir) | ||
|
||
// Confirm the newly moved directory exist | ||
if (fs.existsSync(destDir)) { | ||
console.log(`Successfully moved early access directory '${dirName}' into this repo`) | ||
} else { | ||
throw new Error(`Failed to move early access directory '${dirName}'!`) | ||
} | ||
}) | ||
|
||
// Remove the source content again for good hygiene | ||
rimraf(earlyAccessCloningDir) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/usr/bin/env bash | ||
|
||
# [start-readme] | ||
# | ||
# This script is run on a writer's machine to begin developing Early Access content locally. | ||
# | ||
# [end-readme] | ||
|
||
# Go up a directory | ||
pushd .. > /dev/null | ||
|
||
if [ -d "docs-early-access" ]; then | ||
echo "A 'docs-early-access' directory already exists! Try script/early-access/feature-branch.js." | ||
popd > /dev/null | ||
exit 0 | ||
fi | ||
|
||
# Clone the repo | ||
git clone git@github.com:github/docs-early-access.git | ||
|
||
# Go back to the previous working directory | ||
popd > /dev/null | ||
|
||
# Symlink the local docs-early-access repo into this repo | ||
node script/early-access/symlink-from-local-repo.js -p ../docs-early-access | ||
|
||
echo -e '\nDone!' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
#!/usr/bin/env node | ||
|
||
// [start-readme] | ||
// | ||
// This script is run on a writer's machine while developing Early Access content locally. | ||
// You must pass the script the location of your local copy of | ||
// the `github/docs-early-access` git repo as the first argument. | ||
// | ||
// [end-readme] | ||
|
||
const rimraf = require('rimraf').sync | ||
const fs = require('fs') | ||
const path = require('path') | ||
const program = require('commander') | ||
|
||
// Early Access details | ||
const earlyAccessRepo = 'docs-early-access' | ||
const earlyAccessDirName = 'early-access' | ||
const earlyAccessRepoUrl = `https://github.com/github/${earlyAccessRepo}` | ||
|
||
program | ||
.description(`Create or destroy symlinks to your local "${earlyAccessRepo}" repository.`) | ||
.option('-p, --path-to-early-access-repo <PATH>', `path to a local checkout of ${earlyAccessRepoUrl}`) | ||
.option('-u, --unlink', 'remove the symlinks') | ||
.parse(process.argv) | ||
|
||
const { pathToEarlyAccessRepo, unlink } = program | ||
|
||
if (!pathToEarlyAccessRepo && !unlink) { | ||
throw new Error('Must provide either `--path-to-early-access-repo <PATH>` or `--unlink`') | ||
} | ||
|
||
let earlyAccessLocalRepoDir | ||
|
||
// If creating symlinks, run some extra validation | ||
if (!unlink && pathToEarlyAccessRepo) { | ||
earlyAccessLocalRepoDir = path.resolve(process.cwd(), pathToEarlyAccessRepo) | ||
|
||
let dirStats | ||
try { | ||
dirStats = fs.statSync(earlyAccessLocalRepoDir) | ||
} catch (err) { | ||
dirStats = null | ||
} | ||
|
||
if (!dirStats) { | ||
throw new Error(`The local "${earlyAccessRepo}" repo directory does not exist:`, earlyAccessLocalRepoDir) | ||
} | ||
if (dirStats && !dirStats.isDirectory()) { | ||
throw new Error(`A non-directory entry exists at the local "${earlyAccessRepo}" repo directory location:`, earlyAccessLocalRepoDir) | ||
} | ||
} | ||
|
||
const destinationDirNames = ['content', 'data', 'assets/images'] | ||
const destinationDirsMap = destinationDirNames | ||
.reduce( | ||
(map, dirName) => { | ||
map[dirName] = path.join(process.cwd(), dirName, earlyAccessDirName) | ||
return map | ||
}, | ||
{} | ||
) | ||
|
||
// Remove all existing early access directories from this repo | ||
destinationDirNames.forEach((dirName) => { | ||
const destDir = destinationDirsMap[dirName] | ||
rimraf(destDir) | ||
console.log(`- Removed symlink for early access directory '${dirName}' from this repo`) | ||
}) | ||
|
||
// If removing symlinks, just stop here! | ||
if (unlink) { | ||
process.exit(0) | ||
} | ||
|
||
// | ||
// Otherwise, keep going... | ||
// | ||
|
||
// Move the latest early access source directories into this repo | ||
destinationDirNames.forEach((dirName) => { | ||
const sourceDir = path.join(earlyAccessLocalRepoDir, dirName) | ||
const destDir = destinationDirsMap[dirName] | ||
|
||
// If the source directory doesn't exist, skip it | ||
if (!fs.existsSync(sourceDir)) { | ||
console.warn(`Early access directory '${dirName}' does not exist. Skipping...`) | ||
return | ||
} | ||
|
||
// Create a symbolic link to the directory | ||
fs.symlinkSync(sourceDir, destDir, 'junction') | ||
|
||
// Confirm the newly moved directory exist | ||
if (!fs.existsSync(destDir)) { | ||
throw new Error(`Failed to symlink early access directory '${dirName}'!`) | ||
} | ||
if (!fs.lstatSync(destDir).isSymbolicLink()) { | ||
throw new Error(`The early access directory '${dirName}' entry is not a symbolic link!`) | ||
} | ||
if (!fs.statSync(destDir).isDirectory()) { | ||
throw new Error(`The early access directory '${dirName}' entry's symbolic link does not refer to a directory!`) | ||
} | ||
|
||
console.log(`+ Added symlink for early access directory '${dirName}' into this repo`) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,159 @@ | ||
#!/usr/bin/env node | ||
|
||
// [start-readme] | ||
// | ||
// This script is run on a writer's machine while developing Early Access content locally. It | ||
// updates the data and image paths to either include `early-access` or remove it. | ||
// | ||
// [end-readme] | ||
|
||
const fs = require('fs') | ||
const path = require('path') | ||
const program = require('commander') | ||
const walk = require('walk-sync') | ||
const { escapeRegExp, last } = require('lodash') | ||
const yaml = require('js-yaml') | ||
const patterns = require('../../lib/patterns') | ||
const earlyAccessContent = path.posix.join(process.cwd(), 'content/early-access') | ||
const earlyAccessData = path.posix.join(process.cwd(), 'data/early-access') | ||
const earlyAccessImages = path.posix.join(process.cwd(), 'assets/images/early-access') | ||
|
||
program | ||
.description('Update data and image paths.') | ||
.option('-p, --path-to-early-access-content-file <PATH>', 'Path to a specific content file. Defaults to all Early Access content files if not provided.') | ||
.option('-a, --add', 'Add "early-access" to data and image paths.') | ||
.option('-r, --remove', 'Remove "early-access" from data and image paths.') | ||
.parse(process.argv) | ||
|
||
if (!(program.add || program.remove)) { | ||
console.error('Error! Must specify either `--add` or `--remove`.') | ||
process.exit(1) | ||
} | ||
|
||
let earlyAccessContentAndDataFiles | ||
if (program.pathToEarlyAccessContentFile) { | ||
earlyAccessContentAndDataFiles = path.posix.join(process.cwd(), program.pathToEarlyAccessContentFile) | ||
|
||
if (!fs.existsSync(earlyAccessContentAndDataFiles)) { | ||
console.error(`Error! ${program.pathToEarlyAccessContentFile} can't be found. Make sure the path starts with 'content/early-access'.`) | ||
process.exit(1) | ||
} | ||
earlyAccessContentAndDataFiles = [earlyAccessContentAndDataFiles] | ||
} else { | ||
// Gather the EA content and data files | ||
earlyAccessContentAndDataFiles = walk(earlyAccessContent, { includeBasePath: true, directories: false }) | ||
.concat(walk(earlyAccessData, { includeBasePath: true, directories: false })) | ||
} | ||
|
||
// Update the EA content and data files | ||
earlyAccessContentAndDataFiles | ||
.forEach(file => { | ||
const oldContents = fs.readFileSync(file, 'utf8') | ||
|
||
// Get all the data references in each file that exist in data/early-access | ||
const dataRefs = (oldContents.match(patterns.dataReference) || []) | ||
.filter(dataRef => dataRef.includes('variables') ? checkVariable(dataRef) : checkReusable(dataRef)) | ||
|
||
// Get all the image references in each file that exist in assets/images/early-access | ||
const imageRefs = (oldContents.match(patterns.imagePath) || []) | ||
.filter(imageRef => checkImage(imageRef)) | ||
|
||
const replacements = {} | ||
|
||
if (program.add) { | ||
dataRefs | ||
// Since we're adding early-access to the path, filter for those that do not already include it | ||
.filter(dataRef => !dataRef.includes('data early-access.')) | ||
// Add to the { oldRef: newRef } replacements object | ||
.forEach(dataRef => { | ||
replacements[dataRef] = dataRef.replace(/({% data )(.*)/, '$1early-access.$2') | ||
}) | ||
|
||
imageRefs | ||
// Since we're adding early-access to the path, filter for those that do not already include it | ||
.filter(imageRef => !imageRef.split('/').includes('early-access')) | ||
// Add to the { oldRef: newRef } replacements object | ||
.forEach(imageRef => { | ||
replacements[imageRef] = imageRef.replace('/assets/images/', '/assets/images/early-access/') | ||
}) | ||
} | ||
|
||
if (program.remove) { | ||
dataRefs | ||
// Since we're removing early-access from the path, filter for those that include it | ||
.filter(dataRef => dataRef.includes('{% data early-access.')) | ||
// Add to the { oldRef: newRef } replacements object | ||
.forEach(dataRef => { | ||
replacements[dataRef] = dataRef.replace('early-access.', '') | ||
}) | ||
|
||
imageRefs | ||
// Since we're removing early-access from the path, filter for those that include it | ||
.filter(imageRef => imageRef.split('/').includes('early-access')) | ||
// Add to the { oldRef: newRef } replacements object | ||
.forEach(imageRef => { | ||
replacements[imageRef] = imageRef.replace('/assets/images/early-access/', '/assets/images/') | ||
}) | ||
} | ||
|
||
// Return early if nothing to replace | ||
if (!Object.keys(replacements).length) { | ||
return | ||
} | ||
|
||
// Make the replacement in the content | ||
let newContents = oldContents | ||
Object.entries(replacements).forEach(([oldRef, newRef]) => { | ||
newContents = newContents.replace(new RegExp(escapeRegExp(oldRef), 'g'), newRef) | ||
}) | ||
|
||
// Write the updated content | ||
fs.writeFileSync(file, newContents) | ||
}) | ||
|
||
console.log('Done! Run "git status" in your docs-early-access checkout to see the changes.\n') | ||
|
||
function checkVariable (dataRef) { | ||
// Get the data filepath from the data reference, | ||
// where the data reference looks like: {% data variables.foo.bar %} | ||
// and the data filepath looks like: data/variables/foo.yml with key of 'bar'. | ||
const variablePathArray = dataRef.match(/{% data (.*?) %}/)[1].split('.') | ||
// If early access is part of the path, remove it (since the path below already includes it) | ||
.filter(n => n !== 'early-access') | ||
|
||
// Given a string `variables.foo.bar` split into an array, we want the last segment 'bar', which is the variable key. | ||
// Then pop 'bar' off the array because it's not really part of the filepath. | ||
// The filepath we want is `variables/foo.yml`. | ||
const variableKey = last(variablePathArray); variablePathArray.pop() | ||
const variablePath = path.posix.join(earlyAccessData, `${variablePathArray.join('/')}.yml`) | ||
|
||
// If the variable file doesn't exist in data/early-access, exclude it | ||
if (!fs.existsSync(variablePath)) return false | ||
|
||
// If the variable file exists but doesn't have the referenced key, exclude it | ||
const variableFileContent = yaml.safeLoad(fs.readFileSync(variablePath, 'utf8')) | ||
return variableFileContent[variableKey] | ||
} | ||
|
||
function checkReusable (dataRef) { | ||
// Get the data filepath from the data reference, | ||
// where the data reference looks like: {% data reusables.foo.bar %} | ||
// and the data filepath looks like: data/reusables/foo/bar.md. | ||
const reusablePath = dataRef.match(/{% data (.*?) %}/)[1].split('.') | ||
// If early access is part of the path, remove it (since the path below already includes it) | ||
.filter(n => n !== 'early-access') | ||
.join('/') | ||
|
||
// If the reusable file doesn't exist in data/early-access, exclude it | ||
return fs.existsSync(`${path.posix.join(earlyAccessData, reusablePath)}.md`) | ||
} | ||
|
||
function checkImage (imageRef) { | ||
const imagePath = imageRef | ||
.replace('/assets/images/', '') | ||
// If early access is part of the path, remove it (since the path below already includes it) | ||
.replace('early-access', '') | ||
|
||
// If the image file doesn't exist in assets/images/early-access, exclude it | ||
return fs.existsSync(path.posix.join(earlyAccessImages, imagePath)) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,46 @@ | ||
const config = require('../../lib/crowdin-config').read() | ||
const loadPages = require('../../lib/pages') | ||
const ignoredPagePaths = config.files[0].ignore | ||
const ignoredDataPaths = config.files[2].ignore | ||
|
||
describe('crowdin.yml config file', () => { | ||
let pages | ||
beforeAll(async (done) => { | ||
pages = await loadPages() | ||
done() | ||
}) | ||
|
||
test('has expected file stucture', async () => { | ||
expect(config.files.length).toBe(3) | ||
expect(config.files[0].source).toBe('/content/**/*.md') | ||
expect(config.files[0].ignore).toContain('/content/README.md') | ||
}) | ||
|
||
test('ignores all Early Access paths', async () => { | ||
expect(ignoredPagePaths).toContain('/content/early-access') | ||
expect(ignoredDataPaths).toContain('/data/early-access') | ||
}) | ||
|
||
test('ignores all hidden pages', async () => { | ||
const hiddenPages = pages | ||
.filter(page => page.hidden && page.languageCode === 'en') | ||
.map(page => `/content/${page.relativePath}`) | ||
const overlooked = hiddenPages.filter(page => !isIgnored(page, ignoredPagePaths)) | ||
const message = `Found some hidden pages that are not yet excluded from localization. | ||
Please copy and paste the lines below into the \`ignore\` section of /crowdin.yml: \n\n"${overlooked.join('",\n"')}"` | ||
|
||
// This may not be true anymore given the separation of Early Access docs | ||
// expect(hiddenPages.length).toBeGreaterThan(0) | ||
expect(ignoredPagePaths.length).toBeGreaterThan(0) | ||
expect(overlooked, message).toHaveLength(0) | ||
}) | ||
}) | ||
|
||
// file is ignored if its exact filename in the list, | ||
// or if it's within an ignored directory | ||
function isIgnored (filename, ignoredPagePaths) { | ||
return ignoredPagePaths.some(ignoredPath => { | ||
const isDirectory = !ignoredPath.endsWith('.md') | ||
return ignoredPath === filename || (isDirectory && filename.startsWith(ignoredPath)) | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,60 @@ | ||
const walkSync = require('walk-sync') | ||
const fs = require('fs').promises | ||
|
||
const REPO_REGEXP = /\/\/github\.com\/github\/(?!docs[/'"\n])([\w-.]+)/gi | ||
|
||
// These are a list of known public repositories in the GitHub organization | ||
const ALLOW_LIST = new Set([ | ||
'site-policy', | ||
'roadmap', | ||
'linguist', | ||
'super-linter', | ||
'backup-utils', | ||
'codeql-action-sync-tool', | ||
'codeql-action', | ||
'platform-samples', | ||
'github-services', | ||
'explore', | ||
'markup', | ||
'hubot', | ||
'VisualStudio', | ||
'codeql', | ||
'gitignore', | ||
'feedback', | ||
'semantic', | ||
'git-lfs', | ||
'git-sizer', | ||
'dmca', | ||
'gov-takedowns', | ||
'janky', | ||
'rest-api-description', | ||
'smimesign', | ||
'tweetsodium', | ||
'choosealicense.com' | ||
]) | ||
|
||
describe('check for repository references', () => { | ||
const filenames = walkSync(process.cwd(), { | ||
directories: false, | ||
ignore: [ | ||
'.git', | ||
'dist', | ||
'node_modules', | ||
'translations', | ||
'content/early-access', | ||
'lib/rest/**/*.json', | ||
'lib/webhooks/**/*.json', | ||
'ownership.yaml', | ||
'docs/index.yaml', | ||
'lib/excluded-links.js' | ||
] | ||
}) | ||
|
||
test.each(filenames)('in file %s', async (filename) => { | ||
const file = await fs.readFile(filename, 'utf8') | ||
const matches = Array.from(file.matchAll(REPO_REGEXP)) | ||
.map(([, repoName]) => repoName) | ||
.filter(repoName => !ALLOW_LIST.has(repoName)) | ||
expect(matches).toHaveLength(0) | ||
}) | ||
}) |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
const fs = require('fs') | ||
const path = require('path') | ||
|
||
const { GITHUB_ACTIONS, GITHUB_REPOSITORY } = process.env | ||
const runningActionsOnInternalRepo = GITHUB_ACTIONS === 'true' && GITHUB_REPOSITORY === 'github/docs-internal' | ||
const testViaActionsOnly = runningActionsOnInternalRepo ? test : test.skip | ||
|
||
describe('cloning early-access', () => { | ||
testViaActionsOnly('the content directory exists', async () => { | ||
const eaContentDir = path.join(process.cwd(), 'content/early-access') | ||
expect(fs.existsSync(eaContentDir)).toBe(true) | ||
}) | ||
|
||
testViaActionsOnly('the data directory exists', async () => { | ||
const eaContentDir = path.join(process.cwd(), 'data/early-access') | ||
expect(fs.existsSync(eaContentDir)).toBe(true) | ||
}) | ||
|
||
testViaActionsOnly('the assets/images directory exists', async () => { | ||
const eaContentDir = path.join(process.cwd(), 'assets/images/early-access') | ||
expect(fs.existsSync(eaContentDir)).toBe(true) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This comment was marked as spam.
Sorry, something went wrong.