-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
51 changed files
with
669 additions
and
694 deletions.
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 |
---|---|---|
@@ -0,0 +1,52 @@ | ||
name: Update package version for release & hotfix branches | ||
|
||
on: | ||
push: | ||
branches: [release/*, hotfix/*] | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-version: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- uses: actions/setup-node@v2 | ||
- name: update package version | ||
id: vars | ||
run: | | ||
BRANCH_NAME="${GITHUB_REF#refs/heads/}" | ||
PACKAGE_VERSION="${GITHUB_REF##*/}" | ||
echo ::set-output name=branch::${BRANCH_NAME} | ||
if [[ $PACKAGE_VERSION =~ ^v[0-9]+\.[0-9]+(\.[0-9]+)?$ ]] | ||
then | ||
if [[ $PACKAGE_VERSION =~ ^v[0-9]+\.[0-9]+$ ]] | ||
then | ||
PACKAGE_VERSION="${PACKAGE_VERSION}.0" | ||
fi | ||
echo ::set-output name=version::${PACKAGE_VERSION} | ||
git config user.name 'github-actions[bot]' | ||
git config user.email 'github-actions[bot]@users.noreply.github.com' | ||
if npm version ${PACKAGE_VERSION} | tee >( grep -q 'npm ERR! Version not changed' ) | ||
then | ||
echo "Package version is already in sync with branch name." | ||
echo ::set-output name=should_create_pr::0 | ||
exit 0 | ||
fi | ||
echo ::set-output name=should_create_pr::1 | ||
git push -u origin HEAD:"dev/update-version-${PACKAGE_VERSION}" | ||
else | ||
echo "Branch name ${BRANCH_NAME} does not have the correct format with package version." | ||
exit 1 | ||
fi | ||
- name: create version update pr | ||
if: steps.vars.outputs.should_create_pr == 1 | ||
uses: repo-sync/pull-request@v2 | ||
with: | ||
source_branch: "dev/update-version-${{ steps.vars.outputs.version }}" | ||
destination_branch: "${{ steps.vars.outputs.branch }}" | ||
pr_title: "Update Package Version to ${{ steps.vars.outputs.version }}" | ||
pr_body: "*An automated PR which updates the version number in package.json and package-lock.json files*" | ||
github_token: ${{ secrets.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,27 @@ | ||
/** | ||
* Generates a default result limit for each vertical on the universal page. The | ||
* default is taken from the vertical's `universalLimit`, specified in the related | ||
* page's VTC. If there is no such `universalLimit`, the back-end default of 10 will | ||
* be used. | ||
* | ||
* @param {Object} pageConfigs - The configurations for each page. | ||
* @returns {Object} The partial of the search configuration related to universal limits. | ||
*/ | ||
module.exports = function getDefaultUniversalLimit(pageConfigs) { | ||
const universalLimit = Object.entries(pageConfigs) | ||
.filter(([pageName, _]) => pageName != 'index') | ||
.reduce((limit, [_, pageConfig]) => { | ||
const verticalKey = pageConfig.verticalKey; | ||
const hasUniversalLimit = | ||
pageConfig.verticalsToConfig && | ||
pageConfig.verticalsToConfig[verticalKey] && | ||
pageConfig.verticalsToConfig[verticalKey].universalLimit; | ||
if (hasUniversalLimit) { | ||
limit[verticalKey] = pageConfig.verticalsToConfig[verticalKey].universalLimit; | ||
} | ||
|
||
return limit; | ||
}, {}); | ||
|
||
return { universalLimit }; | ||
} |
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,15 @@ | ||
/** | ||
* This is a block helper for injecting inline JS using handlebars. | ||
* | ||
* First, it wraps the statement in an iife to prevent namespacing issues. | ||
* | ||
* Then, it adds an extra new line to the end of the iife. | ||
* This is necesssary because handlebars removes the first new line it sees after a partial invocation, | ||
* which can result in certain js parsing issues, for example if the last line of the partial is a | ||
* single line js comment, the line immediately after the partial will be included in the comment. | ||
* | ||
* @param {import('handlebars').HelperOptions} opts | ||
*/ | ||
module.exports = function wrapJsPartial(opts) { | ||
return `(() => { \n${opts.fn()}\n })()\n`; | ||
} |
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,5 +1,5 @@ | ||
<!-- Preload the SourceSans fonts used by default in the Theme --> | ||
<link rel="preload" as="font" href="{{relativePath}}/static/assets/fonts/source-sans-pro-v14-latin-300.woff" type="font/woff" crossorigin="anonymous"> | ||
<link rel="preload" as="font" href="{{relativePath}}/static/assets/fonts/source-sans-pro-v14-latin-600.woff" type="font/woff" crossorigin="anonymous"> | ||
<link rel="preload" as="font" href="{{relativePath}}/static/assets/fonts/source-sans-pro-v14-latin-700.woff" type="font/woff" crossorigin="anonymous"> | ||
<link rel="preload" as="font" href="{{relativePath}}/static/assets/fonts/source-sans-pro-v14-latin-regular.woff" type="font/woff" crossorigin="anonymous"> | ||
<link rel="preload" as="font" href="{{relativePath}}/source-sans-pro-v14-latin-300.woff" type="font/woff" crossorigin="anonymous"> | ||
<link rel="preload" as="font" href="{{relativePath}}/source-sans-pro-v14-latin-600.woff" type="font/woff" crossorigin="anonymous"> | ||
<link rel="preload" as="font" href="{{relativePath}}/source-sans-pro-v14-latin-700.woff" type="font/woff" crossorigin="anonymous"> | ||
<link rel="preload" as="font" href="{{relativePath}}/source-sans-pro-v14-latin-regular.woff" type="font/woff" crossorigin="anonymous"> |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
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
Oops, something went wrong.