-
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.
Merge branch 'main' into fix-icon-rendering-in-db-ui-elements
- Loading branch information
Showing
116 changed files
with
4,370 additions
and
4,369 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 |
---|---|---|
|
@@ -2,3 +2,6 @@ | |
source/fonts/**/sources/ | ||
helpers/test.js | ||
tests/backstop_data/engine_scripts/ | ||
out/** | ||
dist/** | ||
**/*.min.js |
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,11 @@ | ||
module.exports = { | ||
env: { | ||
browser: true, | ||
es2021: true, | ||
node: true | ||
}, | ||
extends: ['eslint:recommended'], | ||
rules: { | ||
'no-console': 'error' | ||
} | ||
}; |
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,18 @@ | ||
--- | ||
name: "Cancel Workflow" | ||
description: "Cancel this workflow on failure" | ||
inputs: | ||
token: | ||
description: "A Github PAT" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- run: | | ||
gh api \ | ||
--method POST \ | ||
-H "Accept: application/vnd.github+json" \ | ||
/repos/db-ui/core/actions/runs/${{ github.run_id }}/cancel | ||
shell: bash | ||
env: | ||
GH_TOKEN: ${{ inputs.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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
--- | ||
name: "Download Tar Artifact" | ||
description: "Downloads an artifact and unzips it" | ||
inputs: | ||
name: | ||
description: "Name for artifact" | ||
required: true | ||
path: | ||
description: "Path for unzip" | ||
required: true | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: ⬇ Download build | ||
uses: actions/download-artifact@v3 | ||
with: | ||
name: ${{ inputs.name }} | ||
|
||
- name: 📁 Manage path folder | ||
run: | | ||
if [ ! -d ${{ inputs.path }} ]; then | ||
mkdir ${{ inputs.path }} | ||
fi | ||
export amount=1 | ||
export path="${{ inputs.path }}" | ||
if [[ "$path" == *\/* ]] || [[ "$path" == *\\* ]] | ||
then | ||
export slashes=$(grep -o "/" <<<"$path" | wc -l) | ||
export amount=$((amount + slashes)) | ||
fi | ||
echo "##[set-output name=amount;]$(echo ${amount})" | ||
shell: bash | ||
id: manage-path-folder | ||
|
||
- name: 📦 Unpack Tar | ||
run: tar -zxf ${{ inputs.name }} -C ${{ inputs.path }} --strip-components ${{ steps.manage-path-folder.outputs.amount }} | ||
shell: bash |
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,25 @@ | ||
module.exports = async ({ github, context }, head, base) => { | ||
try { | ||
const { repo, owner } = context.repo; | ||
const result = await github.rest.pulls.create({ | ||
title: 'Auto Update from main', | ||
owner, | ||
repo, | ||
head, | ||
base, | ||
body: '(o゜▽゜)o ☆ ☜(゚ヮ゚☜)' | ||
}); | ||
|
||
await github.rest.issues.addLabels({ | ||
owner, | ||
repo, | ||
issue_number: result.data.number, | ||
labels: ['automated update'] | ||
}); | ||
|
||
return result.data.html_url; | ||
} catch (e) { | ||
console.error(e); | ||
} | ||
return false; | ||
}; |
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,63 @@ | ||
#!/usr/bin/env bash | ||
|
||
if [[ $NAME == "true" ]]; then | ||
echo "Erro: Missing NAME variable" | ||
exit 1 | ||
fi | ||
|
||
echo "➕ Create temp or public dir: $NAME" | ||
if [[ $RELEASE == "true" ]]; then | ||
mkdir temp | ||
echo " Created 'temp' dir" | ||
else | ||
mkdir public | ||
echo " Created 'public' dir" | ||
fi | ||
|
||
|
||
echo "📥 Get gh-pages tar" | ||
curl -L https://github.com/db-ui/core/tarball/gh-pages --output gh-pages | ||
|
||
echo "📦 Unpack Tar" | ||
if [[ $RELEASE == "true" ]]; then | ||
tar -zxf gh-pages -C temp --strip-components 1 | ||
else | ||
tar -zxf gh-pages -C public --strip-components 1 | ||
fi | ||
|
||
echo "📁 Bundle public" | ||
if [[ $RELEASE == "true" ]]; then | ||
echo " Move ./out ./public" | ||
mv ./out ./public | ||
cp -R ./public out | ||
if [ -d ./temp/review ]; then | ||
echo " Move ./temp/review ./public" | ||
mv ./temp/review ./public | ||
fi | ||
if [ -d ./temp/version ]; then | ||
echo " Move ./temp/version ./public" | ||
mv ./temp/version ./public | ||
fi | ||
fi | ||
|
||
if [[ $PRE_RELEASE == "true" || $RELEASE == "true" ]]; then | ||
if [[ ! -d ./public/version ]]; then | ||
echo " Make dir ./public/version" | ||
mkdir ./public/version | ||
fi | ||
if [[ -d ./public/version/"$NAME" ]]; then | ||
echo " Remove dir ./public/version/$NAME" | ||
rm -rf ./public/version/"$NAME" | ||
fi | ||
mv ./out ./public/version/"$NAME" | ||
else | ||
if [[ ! -d ./public/review ]]; then | ||
echo " Make dir ./public/review" | ||
mkdir ./public/review | ||
fi | ||
if [[ -d ./public/review/"$NAME" ]]; then | ||
echo " Remove dir ./public/review/$NAME" | ||
rm -rf ./public/review/"$NAME" | ||
fi | ||
mv ./out ./public/review/"$NAME" | ||
fi |
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,55 @@ | ||
/* | ||
* Fetches all branches and deletes all review-branches in github pages | ||
*/ | ||
const FS = require('fs'); | ||
|
||
const TAG = 'cleanup-gh-pages:'; | ||
|
||
const removeOldFromPath = (isTag, data) => { | ||
const path = `public/${isTag ? 'version' : 'review'}`; | ||
if (FS.existsSync(path) && data?.length > 0) { | ||
const dirsToDelete = FS.readdirSync(path).filter( | ||
(file) => !data.find((branch) => branch.name === file) | ||
); | ||
if (dirsToDelete?.length > 0) { | ||
console.log( | ||
TAG, | ||
`Start removing ${isTag ? 'tags' : 'branches'} from gh-pages` | ||
); | ||
console.log(TAG, dirsToDelete); | ||
dirsToDelete.forEach((dir) => { | ||
FS.rmSync(`${path}/${dir}`, { | ||
recursive: true, | ||
force: true | ||
}); | ||
console.log(TAG, `deleted ${isTag ? 'tag' : 'branch'} ${dir}`); | ||
}); | ||
return true; | ||
} else { | ||
console.log( | ||
TAG, | ||
`All ${isTag ? 'tags' : 'branches'} are up to date` | ||
); | ||
} | ||
} | ||
|
||
return false; | ||
}; | ||
|
||
module.exports = async ({ github, context }) => { | ||
const { repo, owner } = context.repo; | ||
const branches = await github.rest.repos.listBranches({ | ||
owner, | ||
repo | ||
}); | ||
const tags = await github.rest.repos.listTags({ | ||
owner, | ||
repo | ||
}); | ||
|
||
return { | ||
deploy: | ||
removeOldFromPath(false, branches.data) || | ||
removeOldFromPath(true, tags.data) | ||
}; | ||
}; |
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,31 @@ | ||
name: Leaked Secrets Scan | ||
|
||
on: | ||
workflow_call: | ||
|
||
jobs: | ||
TruffleHog: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: ⬇ Checkout repo | ||
uses: actions/checkout@v3 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: ↔ Extract branch name | ||
shell: bash | ||
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})" | ||
id: extract_branch | ||
|
||
- name: 🐷 TruffleHog OSS | ||
uses: trufflesecurity/[email protected] | ||
with: | ||
path: ./ | ||
base: ${{ steps.extract_branch.outputs.branch }} | ||
head: HEAD | ||
|
||
- name: 💀 Killing me softly | ||
uses: ./.github/actions/cancel-workflow | ||
if: failure() | ||
with: | ||
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
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.