From 7a49a2fce26c8b76f13b6d42f391ede315732614 Mon Sep 17 00:00:00 2001 From: Wes Dean <87149725+wesley-dean-gsa@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:41:36 -0400 Subject: [PATCH 01/11] Preclude stylelint from touching .scss files --- .mega-linter.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.mega-linter.yml b/.mega-linter.yml index b442c93d..b68bc74e 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -55,3 +55,7 @@ REPOSITORY_DEVSKIM_ARGUMENTS: "--skip-git-ignored-files" BASH_SHFMT_ARGUMENTS: -i 2 -bn -ci -sr -kp REPOSITORY_TRUFFLEHOG_ARGUMENTS: "--exclude-paths=.trufflehogignore" + +# Don't let stylelint at the SCSS files -- it breaks 'em +CSS_STYLELINT_FILE_NAMES_REGEX: + - ".css" From 70e0f174ddeee4415023ae98cbe6ef3c46fb6cae Mon Sep 17 00:00:00 2001 From: Wes Dean <87149725+wesley-dean-gsa@users.noreply.github.com> Date: Mon, 5 Aug 2024 16:43:25 -0400 Subject: [PATCH 02/11] Update .mega-linter.yml Only scan changed files, not everything --- .mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index b68bc74e..f94e9a76 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -26,7 +26,7 @@ DISABLE_LINTERS: ] # only scan new / updated files, not everything -VALIDATE_ALL_CODEBASE: true +VALIDATE_ALL_CODEBASE: false # don't print the alpaca -- it's cute, but we don't need it in the logs PRINT_ALPACA: false From a4d4db6e8319040377fba176244a4b0cfc965b72 Mon Sep 17 00:00:00 2001 From: Wes Dean <87149725+wesley-dean-gsa@users.noreply.github.com> Date: Mon, 5 Aug 2024 17:00:59 -0400 Subject: [PATCH 03/11] Update .mega-linter.yml --- .mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index f94e9a76..f60b1790 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -57,5 +57,5 @@ BASH_SHFMT_ARGUMENTS: -i 2 -bn -ci -sr -kp REPOSITORY_TRUFFLEHOG_ARGUMENTS: "--exclude-paths=.trufflehogignore" # Don't let stylelint at the SCSS files -- it breaks 'em -CSS_STYLELINT_FILE_NAMES_REGEX: +CSS_STYLELINT_FILE_EXTENSIONS: - ".css" From 5ba291878636c0352ec2fca67616f864f6ec5b74 Mon Sep 17 00:00:00 2001 From: Wes Dean <87149725+wesley-dean-gsa@users.noreply.github.com> Date: Tue, 6 Aug 2024 11:37:28 -0400 Subject: [PATCH 04/11] Update .mega-linter.yml it wants a newline.... --- .mega-linter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.mega-linter.yml b/.mega-linter.yml index 138aa059..ac0bd3c6 100644 --- a/.mega-linter.yml +++ b/.mega-linter.yml @@ -66,4 +66,4 @@ SPELL_CSPELL_FILE_EXTENSIONS: - ".md" # So SARIF files for resolved issues aren't re-sent -CLEAR_REPORT_FOLDER: true \ No newline at end of file +CLEAR_REPORT_FOLDER: true From 18b14307fe08c5708da3e977beb274b206ca1486 Mon Sep 17 00:00:00 2001 From: Wes Dean Date: Tue, 6 Aug 2024 12:35:02 -0400 Subject: [PATCH 05/11] Pin updated GHA versions --- .github/workflows/megalinter.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/megalinter.yml b/.github/workflows/megalinter.yml index a9214729..0991b77b 100644 --- a/.github/workflows/megalinter.yml +++ b/.github/workflows/megalinter.yml @@ -9,6 +9,7 @@ on: - main workflow_dispatch: + permissions: contents: write issues: write @@ -49,7 +50,7 @@ jobs: # Upload MegaLinter artifacts - name: Archive production artifacts if: always() - uses: actions/upload-artifact@a8a3f3ad30e3422c9c7b888a15615d19a852ae32 # pin@v3 + uses: actions/upload-artifact@834a144ee995460fba8ed112a2fc961b36a5ec5a # pin@v4.3.6 with: name: MegaLinter reports path: | @@ -87,12 +88,12 @@ jobs: - name: Check to see if the SARIF a was generated id: sarif_file_exists - uses: andstor/file-existence-action@20b4d2e596410855db8f9ca21e96fbe18e12930b # pin@v2 + uses: andstor/file-existence-action@076e0072799f4942c8bc574a82233e1e4d13e9d6 # pin@v3.0.0 with: files: "megalinter-reports/megalinter-report.sarif" - name: Upload MegaLinter scan results to GitHub Security tab if: steps.sarif_file_exists.outputs.files_exists == 'true' - uses: github/codeql-action/upload-sarif@3e0e84636c6f5df46a2cb232ae1dd1384713150d # pin@v2 + uses: github/codeql-action/upload-sarif@afb54ba388a7dca6ecae48f608c4ff05ff4cc77a # pin@v3.25.15 with: sarif_file: "megalinter-reports/megalinter-report.sarif" From 8c3db87bd1797dd882e5cff15772b051f43a5e14 Mon Sep 17 00:00:00 2001 From: Wes Dean Date: Tue, 6 Aug 2024 12:40:01 -0400 Subject: [PATCH 06/11] Tidy buildAssets --- config/buildAssets.js | 23 ++++++++++++----------- 1 file changed, 12 insertions(+), 11 deletions(-) diff --git a/config/buildAssets.js b/config/buildAssets.js index 4e961960..f36b34d6 100644 --- a/config/buildAssets.js +++ b/config/buildAssets.js @@ -10,10 +10,11 @@ async function createAssetPaths() { pathPrefix = process.env.BASEURL; } - const assetPath = path.join(__dirname, '../_site/assets'); - let assetDirs = await fs.readdir(assetPath, {withFileTypes: true}) - assetDirs = assetDirs.filter(item => item.isDirectory()) - .map(item => item.name); + const assetPath = path.join(__dirname, "../_site/assets"); + let assetDirs = await fs.readdir(assetPath, { withFileTypes: true }); + assetDirs = assetDirs + .filter((item) => item.isDirectory()) + .map((item) => item.name); const assetsFiles = await Promise.all( assetDirs.map(async (dir) => { @@ -44,13 +45,13 @@ esbuild outdir: "_site/assets", format: "iife", loader: { - '.png': 'file', - '.jpg': 'file', - '.jpeg': 'file', - '.svg': 'file', - '.ttf': 'file', - '.woff': 'file', - '.woff2': 'file', + ".png": "file", + ".jpg": "file", + ".jpeg": "file", + ".svg": "file", + ".ttf": "file", + ".woff": "file", + ".woff2": "file", }, minify: process.env.ELEVENTY_ENV === "production", sourcemap: process.env.ELEVENTY_ENV !== "production", From 570e8639d69d4f22bdefe08f6074192084db03ca Mon Sep 17 00:00:00 2001 From: Wes Dean Date: Tue, 6 Aug 2024 12:55:45 -0400 Subject: [PATCH 07/11] Tidy TTS SASS --- styles/tts-custom-styles.scss | 87 +++++++++++++++++------------------ 1 file changed, 41 insertions(+), 46 deletions(-) diff --git a/styles/tts-custom-styles.scss b/styles/tts-custom-styles.scss index 2dd0a11f..a7a28ce9 100644 --- a/styles/tts-custom-styles.scss +++ b/styles/tts-custom-styles.scss @@ -1,30 +1,28 @@ @use "uswds-core" as *; -// Add any USWDS overrides here -// Alternatively, you could create an overrides folder and create individual override files +$tts-tagline-bg: #1f303e; +$tts-title-banner-background-color: #000; +$tts-title-banner-h1-foreground-color: #fff; -// custom tts color -$tts-tagline-bg: #1F303E; - -// USWDS Hero component .usa-hero--tts { + background-position-x: right; + background-repeat: no-repeat; + background-size: cover; height: 10rem; + padding: 0; width: 100%; - background-repeat: no-repeat; - background-position-x: right; - background-size: cover; - padding: 0; + @include at-media('mobile-lg') { - // This shifts the hero over to the right so that most of the background image isn't covered by the tagline. The left side of the hero image will not line up perfectly with the right side of the tagline, since the widths of both elements will vary depending on screen width. A bit of overlap on this edge will prevent empty space between the two. - position: absolute; - left:40%; - height:100%; + height: 100%; + left: 40%; + position: absolute; width: 60%; } } .tts-hero-wrap { background: url('../_img/TTS_Header_Dev.png'); + background-color: $tts-tagline-bg; background-size: cover; } @@ -33,18 +31,12 @@ $tts-tagline-bg: #1F303E; object-fit: contain; } -.tts-hero-wrap { - background-color: $tts-tagline-bg; -} - .tts-tagline { @include at-media('mobile-lg') { - // Setting a min height so that the hero height doesn't need to rely on tagline length min-height: 350px; } } -// Services pages .service .usa-card__container { border-radius: 0; } @@ -62,18 +54,18 @@ $tts-tagline-bg: #1F303E; } .usa-prose p { - max-width: unset; + max-width: unset; } footer { - a { - color: color('base-lightest'); - text-decoration: none; + a { + color: color('base-lightest'); + text-decoration: none; + } - } - a:hover { - text-decoration: underline; - } + a:hover { + text-decoration: underline; + } } .usa-social-link img { @@ -82,33 +74,36 @@ footer { .tts-service-logo { height: 50px; - img { - object-fit: contain; - max-width: 180px; - } -} -.tts-title-banner { - background: url(../_img/Services_Background.png) center no-repeat #000000; + img { + max-width: 180px; + object-fit: contain; + } } - -.tts-title-banner h1 { - text-transform: uppercase; - font-size: 3.25rem; - color: #ffffff; - padding: 4.75rem 0; - margin: 0; - text-align: center; +.tts-title-banner { + background: url('../_img/Services_Background.png') center no-repeat $tts-title-banner-background-color; + + h1 { + color: $tts-title-banner-h1-foreground-color; + font-size: 3.25rem; + margin: 0; + padding: 4.75rem 0; + text-align: center; + text-transform: uppercase; + } } -h2, h3, h4, h5 { - font-family: $theme-font-type-sans !important; +h2, +h3, +h4, +h5 { + font-family: $theme-font-type-sans !important; } .usa-identifier__logos img { - width: 2.5rem; height: 2.5rem; + width: 2.5rem; } .usa-prose .usa-card:last-child { From dbb41cf66aa4ebdc1e73b4092e634bed1854f50a Mon Sep 17 00:00:00 2001 From: Wes Dean Date: Tue, 6 Aug 2024 12:59:57 -0400 Subject: [PATCH 08/11] More tidying........ --- .github/workflows/megalinter.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/megalinter.yml b/.github/workflows/megalinter.yml index 0991b77b..aa768932 100644 --- a/.github/workflows/megalinter.yml +++ b/.github/workflows/megalinter.yml @@ -9,7 +9,6 @@ on: - main workflow_dispatch: - permissions: contents: write issues: write From 64fd2ef9a3095dc2b58ae68ba3534f863e9c6e69 Mon Sep 17 00:00:00 2001 From: Wes Dean Date: Tue, 6 Aug 2024 13:15:46 -0400 Subject: [PATCH 09/11] Restrict high-level permissions and move them to specific job --- .github/workflows/megalinter.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/megalinter.yml b/.github/workflows/megalinter.yml index aa768932..aa1eba2f 100644 --- a/.github/workflows/megalinter.yml +++ b/.github/workflows/megalinter.yml @@ -10,9 +10,7 @@ on: workflow_dispatch: permissions: - contents: write - issues: write - pull-requests: write + contents: read env: # Comment env block if you do not want to apply fixes From ac84e017873968ceb8d3277359bd1850420b03c9 Mon Sep 17 00:00:00 2001 From: Wes Dean <87149725+wesley-dean-gsa@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:20:02 -0400 Subject: [PATCH 10/11] Update megalinter.yml Enable `APPLY_FIXES` but only for PRs and only create new PRs, don't add commits to this branch... temporarily. --- .github/workflows/megalinter.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/megalinter.yml b/.github/workflows/megalinter.yml index aa1eba2f..aefa50b8 100644 --- a/.github/workflows/megalinter.yml +++ b/.github/workflows/megalinter.yml @@ -15,9 +15,9 @@ permissions: env: # Comment env block if you do not want to apply fixes # Apply linter fixes configuration - APPLY_FIXES: none # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) - APPLY_FIXES_EVENT: all # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) - APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) + APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) + APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) + APPLY_FIXES_MODE: pull_request # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) concurrency: group: ${{ github.ref }}-${{ github.workflow }} From 91a204d79ea288633b8af28770ed8d9036f1a4c2 Mon Sep 17 00:00:00 2001 From: Wes Dean <87149725+wesley-dean-gsa@users.noreply.github.com> Date: Tue, 6 Aug 2024 13:23:22 -0400 Subject: [PATCH 11/11] Update megalinter.yml Since there are no fixes applied, we can move fixes mode back to commit. --- .github/workflows/megalinter.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/megalinter.yml b/.github/workflows/megalinter.yml index aefa50b8..479f0349 100644 --- a/.github/workflows/megalinter.yml +++ b/.github/workflows/megalinter.yml @@ -17,7 +17,7 @@ env: # Apply linter fixes configuration APPLY_FIXES: all # When active, APPLY_FIXES must also be defined as environment variable (in github/workflows/mega-linter.yml or other CI tool) APPLY_FIXES_EVENT: pull_request # Decide which event triggers application of fixes in a commit or a PR (pull_request, push, all) - APPLY_FIXES_MODE: pull_request # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) + APPLY_FIXES_MODE: commit # If APPLY_FIXES is used, defines if the fixes are directly committed (commit) or posted in a PR (pull_request) concurrency: group: ${{ github.ref }}-${{ github.workflow }}