Skip to content

Commit 5e2d8f9

Browse files
authored
Revert "megalint github action (#6716)"
This reverts commit 8dddeb6.
1 parent 8dddeb6 commit 5e2d8f9

File tree

14 files changed

+644
-7012
lines changed

14 files changed

+644
-7012
lines changed

.circleci/config.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,18 +40,45 @@ workflows:
4040
paths:
4141
- ./
4242
- ./public
43+
- test-links:
44+
requires:
45+
- pfe/gatsby-build-and-deploy
4346
- lighthouse:
4447
requires:
4548
- pfe/gatsby-build-and-deploy
4649
filters:
4750
branches:
4851
ignore: main
4952
- deploy:
53+
requires:
54+
- test-links
5055
filters:
5156
branches:
5257
only: main
5358

5459
jobs:
60+
test-links:
61+
docker:
62+
- image: circleci/php:7.2-cli-node-browsers
63+
environment:
64+
BUILD_PATH: /home/circleci/project
65+
working_directory: ~/project
66+
steps:
67+
- pfe/set-terminus-env
68+
- checkout
69+
- run:
70+
name: Import Functions and Variables
71+
command: .circleci/scripts/set-env.sh && source $BASH_ENV
72+
- run:
73+
name: Install Broken Link Checker
74+
command: sudo npm install -g alexlouden/broken-link-checker
75+
- run:
76+
name: Check for merge conflicts
77+
command: .circleci/scripts/merge_conflicts.sh
78+
- run:
79+
name: Test links
80+
command: .circleci/tests/link-checker.sh "https://${TERMINUS_ENV}--${TERMINUS_SITE}.my.pantheonfrontend.website/docs"
81+
5582
lighthouse:
5683
docker:
5784
- image: circleci/php:7.2-cli-node-browsers

.circleci/scripts/import-external-data.sh

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,21 @@ set -e
55

66
cd $BUILD_PATH
77

8+
## Import Terminus releases and command reference
9+
echo "Generate a new Terminus commands.json file"
10+
touch source/data/commands.json
11+
terminus list --format=json > source/data/commands.json
12+
13+
echo "Ajusting output..."
14+
sed -i 's/site_env/site>\.<env/g' source/data/commands.json
15+
sed -i 's/drush_command/command/g' source/data/commands.json
16+
sed -i 's/wp_command/command/g' source/data/commands.json
17+
18+
echo "Update Terminus releases"
19+
curl -H "Authorization: token $GITHUB_TOKEN" https://api.github.com/repos/pantheon-systems/terminus/releases > source/data/terminusReleases.json
20+
head source/data/terminusReleases.json
21+
22+
823
## Import Localdev releases
924
echo "Downloading Localdev changelog..."
1025
wget -O source/data/localdev/changelog.yml https://pantheon-localdev.s3.amazonaws.com/changelog.yml
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#! /bin/bash
2+
set -e
3+
4+
# This script assumes you're already serving the site using --prefix-paths
5+
6+
# This sections excludes domains, which will come in handy when it's expanded for all links
7+
echo "Reading excluded links..."
8+
exclusions=$(sed -r 's/(.*)/--exclude \1/' scripts/exclude.txt | tr '\n' ' ')
9+
10+
echo "Checking for broken links.."
11+
12+
if ./node_modules/broken-link-checker/bin/blc -q -r -o --rateLimit=1000 --host-requests=1 --user-agent='Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/51.0.2704.103 Safari/537.36' $exclusions http://localhost:9000/docs
13+
then
14+
echo "No broken internal links!"
15+
else
16+
exit 1
17+
fi
18+

.circleci/tests/link-checker.sh

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
#! /bin/bash
2+
# This script takes as an argument a target URL to test, then checks recursively for broken (relative) links.
3+
set -e
4+
5+
# Import Functions
6+
source $BUILD_PATH/.circleci/scripts/functions.sh
7+
8+
# Exits if no target is provided as an argument.
9+
if [ "$1" = "" ]; then
10+
echo "You forgot to provide a target."
11+
exit 1
12+
fi
13+
14+
echo "Checking for broken links on ${1} .."
15+
16+
if try3 blc -q -r -e -o $1
17+
then
18+
echo "No broken internal links!"
19+
else
20+
exit 1
21+
fi

.cspell.json

Lines changed: 0 additions & 48 deletions
This file was deleted.

.github/workflows/mega-linter.yml

Lines changed: 0 additions & 89 deletions
This file was deleted.

.gitignore

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,3 @@ yarn-error.log
8282
/.env
8383
/.env.development
8484
/.env.production
85-
86-
# mega-linter creates reports
87-
report/

.markdown-link-check.json

Lines changed: 0 additions & 14 deletions
This file was deleted.

.markdownlint.json

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,8 @@
11
{
22
"MD001": false,
3-
"MD007": false,
43
"MD013": false,
54
"MD023": false,
65
"MD024": false,
7-
"MD026": false,
86
"MD029": false,
97
"MD033": {
108
"allowed_elements": [
@@ -33,7 +31,6 @@
3331
"dfn"
3432
]
3533
},
36-
"MD034": false,
3734
"MD038": false
3835
}
3936

.mega-linter.yml

Lines changed: 0 additions & 12 deletions
This file was deleted.

0 commit comments

Comments
 (0)