Skip to content
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

Benefit Finder Release v0.5.0.beta.1 (Sprint 36) #1593

Merged
merged 171 commits into from
Jul 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
171 commits
Select commit Hold shift + click to select a range
13f63ae
Change thog to send results to s3
Jul 11, 2024
ac75ed1
Change thog to send results to s3 2
Jul 11, 2024
5c2e4a3
Change thog to send results to s3 3
Jul 11, 2024
f657ac2
Change thog to send results to s3 4
Jul 11, 2024
cb14338
Change thog to send results to s3 5
Jul 11, 2024
8f0846d
Change thog to send results to s3 6
Jul 11, 2024
c09d82a
Change thog to send results to s3 7
Jul 11, 2024
4a73b43
Change thog to send results to s3 8
Jul 11, 2024
971418f
PXBF-1554-fix-accordion-open-all: raise state for benefit accordion g…
scottqueen-bixal Jul 11, 2024
fcc7d31
PXBF-1554-fix-accordion-open-all: raise state for benefit accordion g…
scottqueen-bixal Jul 11, 2024
e07cbc4
PXBF-1554-fix-accordion-open-all: include expanded with story
scottqueen-bixal Jul 11, 2024
ca1f281
PXBF-1554-fix-accordion-open-all: move accordion test up to e2e from …
scottqueen-bixal Jul 11, 2024
9611675
Change thog to send results to s3 9
Jul 11, 2024
3f9f48f
Change thog to send results to s3 10
Jul 11, 2024
185a49b
PXBF-1554-fix-accordion-open-all: include new page objects for open a…
scottqueen-bixal Jul 11, 2024
b509c64
PXBF-1554-fix-accordion-open-all: include openAllAccordions e2e test
scottqueen-bixal Jul 11, 2024
d8d8554
PXBF-1554-fix-accordion-open-all: remove console.log
scottqueen-bixal Jul 11, 2024
d4db053
PXBF-1554-fix-accordion-open-all: update test title
scottqueen-bixal Jul 11, 2024
f817726
Change thog to send results to s3 11
Jul 11, 2024
f4cce2c
Change thog to send results to s3 12
Jul 11, 2024
c7b5016
Change thog to send results to s3 13
Jul 11, 2024
b40c3af
Change thog to send results to s3 14
Jul 11, 2024
afaf6d7
Change thog to send results to s3 15
Jul 11, 2024
4ec5822
Change thog to send results to s3 16
Jul 11, 2024
96e2a09
Change thog to send results to s3 17
Jul 11, 2024
d433506
Change thog to send results to s3 18
Jul 11, 2024
e969126
Change thog to send results to s3 19
Jul 11, 2024
5ef8795
Change thog to send results to s3 21
Jul 12, 2024
e2d031f
Change thog to send results to s3 22
Jul 12, 2024
5d803e3
Change thog to send results to s3 23
Jul 12, 2024
d1ab7cf
PXBF-1562-restructure-results-view-b: init zero benefits results head…
scottqueen-bixal Jul 12, 2024
1e0cadc
PXBF-1562-restructure-results-view-b: update results view story
scottqueen-bixal Jul 12, 2024
43c5cf4
PXBF-1562-restructure-results-view-b: update heading component to not…
scottqueen-bixal Jul 12, 2024
5bdf382
PXBF-1562-restructure-results-view-b: updated snapshots
scottqueen-bixal Jul 12, 2024
89c2989
PXBF-1562-restructure-results-view-b: comment out results view and in…
scottqueen-bixal Jul 12, 2024
89cced6
PXBF-1562-restructure-results-view-b: init not eligible benefits bloc…
scottqueen-bixal Jul 12, 2024
944fe87
PXBF-1562-restructure-results-view-b: init eligible benefits block co…
scottqueen-bixal Jul 12, 2024
0ea3fc0
PXBF-1562-restructure-results-view-b: remove log
scottqueen-bixal Jul 12, 2024
c05cc2b
PXBF-1562-restructure-results-view-b: conditional chaining ui content
scottqueen-bixal Jul 12, 2024
7e8b0d1
PXBF-1562-restructure-results-view-b: updated results view with compo…
scottqueen-bixal Jul 12, 2024
7625ea5
PXBF-1562-restructure-results-view-b: new heading blocks variants for…
scottqueen-bixal Jul 12, 2024
05e9250
PXBF-1562-restructure-results-view-b: updated snaps
scottqueen-bixal Jul 12, 2024
c170339
PXBF-1562-restructure-results-view-b: remove log
scottqueen-bixal Jul 12, 2024
300bd31
PXBF-1562-restructure-results-view-b: break results view block out in…
scottqueen-bixal Jul 12, 2024
e967bd0
PXBF-1562-restructure-results-view-b: move most of the components out…
scottqueen-bixal Jul 12, 2024
70d6148
PXBF-1562-restructure-results-view-b: move styles to new component
scottqueen-bixal Jul 12, 2024
70eeb66
PXBF-1562-restructure-results-view-b: new ResultsViewBlock component
scottqueen-bixal Jul 12, 2024
3b4b110
PXBF-1562-restructure-results-view-b: update naming of heading blocks…
scottqueen-bixal Jul 15, 2024
be36a47
PXBF-1562-restructure-results-view-b: wait for element visibility
scottqueen-bixal Jul 15, 2024
aba058c
PXBF-1562-restructure-results-view-b: include screen shots if fail
scottqueen-bixal Jul 15, 2024
e168df4
PXBF-1562-restructure-results-view-b: include screen shots if fail
scottqueen-bixal Jul 15, 2024
fbc7a60
PXBF-1562-restructure-results-view-b: include screen shots if fail, w…
scottqueen-bixal Jul 15, 2024
ba79e73
PXBF-1562-restructure-results-view-b: include screen shots if fail
scottqueen-bixal Jul 15, 2024
253be28
PXBF-1562-restructure-results-view-b: include screen shots if fail, r…
scottqueen-bixal Jul 15, 2024
0a82e48
PXBF-1562-restructure-results-view-b: include screen shots if fail
scottqueen-bixal Jul 15, 2024
857d3cf
Merge pull request #1559 from GSA/1554-fix-accordion-open-all
scottqueen-bixal Jul 15, 2024
d51ee79
Clean up thog scan
Jul 15, 2024
6543793
Clean up thog scan 2
Jul 15, 2024
bd8fada
Clean up thog scan 3
Jul 15, 2024
e7137ba
Clean up thog scan 4
Jul 15, 2024
308c56e
Clean up thog scan 5
Jul 15, 2024
80fb857
Clean up thog scan 6
Jul 15, 2024
f61d23f
Clean up thog scan 7
Jul 15, 2024
7de4f45
Clean up thog scan 8
Jul 15, 2024
a649caa
Clean up thog scan 9
Jul 15, 2024
82e7597
Clean up thog scan 10
Jul 15, 2024
e038992
Clean up thog scan 11
Jul 15, 2024
90ee733
Clean up thog scan 12
Jul 15, 2024
752e435
Clean up thog scan 13
Jul 15, 2024
bfd9760
Clean up thog scan 14
Jul 15, 2024
62de991
Clean up thog scan 15
Jul 15, 2024
eea5175
Clean up thog scan 16
Jul 15, 2024
6dde78d
PXBF-1562-restructure-results-view-b: update accordion test
scottqueen-bixal Jul 16, 2024
db28286
PXBF-1562-restructure-results-view-b: try a wait
scottqueen-bixal Jul 16, 2024
6c1c738
PXBF-1562-restructure-results-view-b: remove wait
scottqueen-bixal Jul 16, 2024
ea6f04f
PXBF-1562-restructure-results-view-b: install same dep as local
scottqueen-bixal Jul 16, 2024
6fdf8e0
PXBF-1562-restructure-results-view-b: simplify test
scottqueen-bixal Jul 16, 2024
196a34e
PXBF-1562-restructure-results-view-b: temp only run webkit in pipe
scottqueen-bixal Jul 16, 2024
cdc60ef
PXBF-1562-restructure-results-view-b: waiting for visibility
scottqueen-bixal Jul 16, 2024
56f6abb
Clean up thog scan 17
Jul 16, 2024
05fcb84
PXBF-1562-restructure-results-view-b: break appart the chain
scottqueen-bixal Jul 16, 2024
26f0c4a
PXBF-1562-restructure-results-view-b: updated cypress dep
scottqueen-bixal Jul 16, 2024
81812a5
PXBF-1562-restructure-results-view-b: move aditional tests in first i…
scottqueen-bixal Jul 16, 2024
a9a6e04
PXBF-1562-restructure-results-view-b: wait forever then try to just c…
scottqueen-bixal Jul 16, 2024
a640c38
PXBF-1562-restructure-results-view-b: update syntax
scottqueen-bixal Jul 16, 2024
3135125
PXBF-1562-restructure-results-view-b: include another check after click
scottqueen-bixal Jul 16, 2024
d7f0f27
PXBF-1562-restructure-results-view-b: include another check after click
scottqueen-bixal Jul 16, 2024
3833255
PXBF-1562-restructure-results-view-b: remove the wait
scottqueen-bixal Jul 16, 2024
bf3f9e7
Clean up thog scan 18
Jul 16, 2024
e11b0ef
PXBF-1562-restructure-results-view-b: ensure component is visilbe first
scottqueen-bixal Jul 16, 2024
3924e17
Clean up thog scan 19
Jul 16, 2024
5320873
PXBF-1562-restructure-results-view-b: clock back to half wait
scottqueen-bixal Jul 16, 2024
5608b57
PXBF-1562-restructure-results-view-b: place back other tests in this …
scottqueen-bixal Jul 16, 2024
7d5f4dd
PXBF-1562-restructure-results-view-b: revert action changes
scottqueen-bixal Jul 16, 2024
f406a42
PXBF-1562-restructure-results-view-b: Merge branch 'dev' of github.co…
scottqueen-bixal Jul 16, 2024
2936991
PXBF-1568-update-packages: update vite
scottqueen-bixal Jul 16, 2024
9ebcb4e
PXBF-1568-update-packages: updated babel
scottqueen-bixal Jul 16, 2024
022e6b3
PXBF-1568-update-packages: updated storybook deps
scottqueen-bixal Jul 16, 2024
9347173
PXBF-1568-update-packages: update vitest dep
scottqueen-bixal Jul 16, 2024
eecc30a
Merge pull request #1563 from GSA/1562-restructure-results-view-b
scottqueen-bixal Jul 16, 2024
e87a4d3
PXBF-1568-update-packages: updated other packages
scottqueen-bixal Jul 16, 2024
b0f9d85
PXBF-1568-update-packages: update storybook
scottqueen-bixal Jul 16, 2024
e39df6c
PXBF-1568-update-packages: updated snaps
scottqueen-bixal Jul 16, 2024
600ce17
PXBF-1568-update-packages: merge dev
scottqueen-bixal Jul 16, 2024
6f58e90
Merge pull request #1569 from GSA/1568-update-packages
scottqueen-bixal Jul 16, 2024
ebf05cd
Thog cleanup 23
Jul 17, 2024
0ca375c
Thog cleanup 24
Jul 17, 2024
8ee9a34
Thog cleanup 25
Jul 17, 2024
197c3c2
Thog cleanup 26
Jul 18, 2024
5dc03a0
Thog cleanup 27
Jul 18, 2024
e0946c0
Thog cleanup 28
Jul 18, 2024
150fb12
Test thog positive
Jul 18, 2024
11aea86
Change Exclusions and update title of issue for thog
Jul 18, 2024
5533c65
Set THog to run on all branches either push or PR
Jul 18, 2024
478f035
Add branch lookup in Cloud.gov login step
Jul 18, 2024
2818f6a
Make conditional for branch PR vs Commit.
Jul 18, 2024
73cb1fe
PXBF-trufflehog-precommit-hook: test
scottqueen-bixal Jul 19, 2024
d452f74
PXBF-trufflehog-precommit-hook: test
scottqueen-bixal Jul 19, 2024
c9ae24f
PXBF-trufflehog-precommit-hook: test
scottqueen-bixal Jul 19, 2024
404b249
PXBF-trufflehog-precommit-hook: test
scottqueen-bixal Jul 19, 2024
c764948
PXBF-trufflehog-precommit-hook: test
scottqueen-bixal Jul 19, 2024
be84492
test
scottqueen-bixal Jul 19, 2024
e79e440
PXBF-trufflehog-precommit-hook: test
scottqueen-bixal Jul 19, 2024
99d90b3
PXBF-trufflehog-precommit-hook: test
scottqueen-bixal Jul 19, 2024
54e5420
PXBF-1544-zero-benefits-view: add zero benefits view validation
nehemiah-abuga Jul 20, 2024
f0dd913
PXBF-1566-include-screenshots-on-failure: include screenshots on failure
nehemiah-abuga Jul 20, 2024
5713e16
PXBF-1566-include-screenshots-on-failure: include screenshots on failure
nehemiah-abuga Jul 20, 2024
ad5b861
PXBF-1566-include-screenshots-on-failure: update failing tests used f…
nehemiah-abuga Jul 20, 2024
d679b9a
PXBF-trufflehog-precommit-hook: include venv in ignore
scottqueen-bixal Jul 22, 2024
038b09e
PXBF-trufflehog-precommit-hook: revert change on README
scottqueen-bixal Jul 22, 2024
b323360
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
e70b9ff
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
9bce603
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
6b2aac8
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
61a9980
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
3835372
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
feaac37
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
2ea26e0
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
89a3547
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
1a7acde
PXBF-trufflehog-precommit-hook: test lint-staged
scottqueen-bixal Jul 22, 2024
b79a797
PXBF-trufflehog-precommit-hook: update trufflehog config
scottqueen-bixal Jul 22, 2024
21a1b74
PXBF-trufflehog-precommit-hook: test README.change
scottqueen-bixal Jul 22, 2024
bae9502
PXBF-trufflehog-precommit-hook: revert test change
scottqueen-bixal Jul 22, 2024
b65a98a
PXBF-trufflehog-precommit-hook: revert test change
scottqueen-bixal Jul 22, 2024
916c5d3
PXBF-trufflehog-precommit-hook: set up new githooks dir
scottqueen-bixal Jul 22, 2024
f1fa4f9
remove old hooks
scottqueen-bixal Jul 22, 2024
0f17b7d
include commit-msg hook
scottqueen-bixal Jul 22, 2024
76db688
include gitconfig as preinstall hook
scottqueen-bixal Jul 22, 2024
5ca76b5
mod hooks
scottqueen-bixal Jul 22, 2024
73126bc
include directions for githook in readme
scottqueen-bixal Jul 22, 2024
855a3c5
Merge pull request #1579 from GSA/1566-include-screenshots-on-failure
scottqueen-bixal Jul 22, 2024
2f39d95
Change thog pipe to only scan dev and main
Jul 22, 2024
6afe2bf
uninstall husky
scottqueen-bixal Jul 22, 2024
4af2e11
Merge branch 'dev' of https://github.com/GSA/px-benefit-finder into dev
Jul 22, 2024
6649bbc
commit msg test
scottqueen-bixal Jul 22, 2024
fbd9eae
test change
scottqueen-bixal Jul 22, 2024
91131d0
PXBF-trufflehog-precommit-hook: revert change
scottqueen-bixal Jul 22, 2024
34fd02d
PXBF-trufflehog-precommit-hook: revert test change
scottqueen-bixal Jul 22, 2024
339bf2b
PXBF-trufflehog-precommit-hook: no need to include relative dir
scottqueen-bixal Jul 22, 2024
b3ab2ea
PXBF-trufflehog-precommit-hook: test 1
gchi25 Jul 22, 2024
c9c7dca
PXBF-trufflehog-precommit-hook: test 2
gchi25 Jul 22, 2024
119ee9b
PXBF-1544-zero-benefits-view: use data attribute for see all benefit …
nehemiah-abuga Jul 22, 2024
fd72d7f
Merge pull request #1583 from GSA/trufflehog-precommit-hook
scottqueen-bixal Jul 22, 2024
d727066
Merge pull request #1578 from GSA/1544-zero-benefits-view
scottqueen-bixal Jul 22, 2024
ad71568
PXBF-1590-git-hooks-bugs: ignore build directory
scottqueen-bixal Jul 23, 2024
49e1bfa
PXBF-1590-git-hooks-bugs: only run js application tests once per comm…
scottqueen-bixal Jul 23, 2024
8fc8f7a
PXBF-1590-git-hooks-bugs: absolute path jq
scottqueen-bixal Jul 23, 2024
baedd47
Merge pull request #1591 from GSA/1590-git-hooks-bugs
scottqueen-bixal Jul 23, 2024
5916a7d
PXBF-1564-content-update-zeroben: new content for not eligible zero b…
scottqueen-bixal Jul 23, 2024
292e6dd
PXBF-1564-content-update-zeroben: new content for not eligible zero b…
scottqueen-bixal Jul 23, 2024
6e60721
Merge pull request #1594 from GSA/1564-content-update-zeroben
scottqueen-bixal Jul 23, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions benefit-finder/.husky/commit-msg → .githooks/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
#!/usr/bin/env sh
. "$(dirname -- "$0")/_/husky.sh"

#!/bin/bash
COMMIT_MESSAGE_FILE="$1"
COMMIT_MESSAGE="$(cat $1)"
COMMITPREFIX=$(git branch | grep '*' | sed 's/* //')
Expand Down
85 changes: 85 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
#!/bin/bash
## Set the root directory in the pipeline
ROOT_DIR=$(git rev-parse --show-toplevel)
CURRENT_DIR="${PWD##*/}"

JS_APP_DIR=benefit-finder
IS_JS_APP=false
USAGOV_APP_DIR=usagov-2021

echo "Current directory ${CURRENT_DIR}"

STAGED_FILES=$(git diff-index --cached --name-only HEAD)

for file in $STAGED_FILES; do
# Check if file is located in the JS_APP_DIR
echo "Found stagged file: $file"
if [[ $file == *$JS_APP_DIR* ]]; then
IS_JS_APP=true
fi
done

# run custom actions for our JS App
if [ $IS_JS_APP = true ]; then
echo "Found a JS application file, running front end task(s)"
# echo "running processes on staged files"
cd $ROOT_DIR/$JS_APP_DIR && npm run lint-staged
if [ $? -eq 0 ]; then
echo "Process succeeded."
cd $ROOT_DIR
else
echo "Process failed."
exit 1
fi
fi

# Check if Python 3 is installed and install if not
if ! command -v python3 &> /dev/null; then
echo "Python 3 is not installed. Attempting to install Python 3..."
brew install python3 || { echo "Failed to install Python 3. Please install it manually."; exit 1; }
fi
# Check if venv module is available in Python, install if not
if ! python3 -c "import venv" &> /dev/null; then
echo "venv module is not available. Python installation might not support venv."
exit 1
fi
# Set up Python virtual environment
if [ ! -d ".venv" ]; then
python3 -m venv .venv
echo "Virtual environment created."
else
echo "Virtual environment already exists."
fi
source .venv/bin/activate
# Check if TruffleHog3 is installed and install if not
if ! command -v trufflehog3 &> /dev/null; then
echo "TruffleHog3 is not installed. Installing TruffleHog3..."
pip install trufflehog3 || { echo "Failed to install TruffleHog3. Please install it manually."; exit 1; }
fi
# Check if jq is installed and install if not
if ! command -v /opt/homebrew/bin/jq &> /dev/null; then
echo "jq is not installed. Installing jq..."
brew install jq || { echo "Failed to install jq. Please install it manually."; exit 1; }
fi
# Determine the branch name locally
BRANCH_NAME=$(git symbolic-ref --short HEAD)
if [ -z "$BRANCH_NAME" ]; then
echo "Failed to determine the branch name. Ensure you are in a Git repository."
exit 1
fi

echo "Scanning branch: $BRANCH_NAME"
# TruffleHog3 Scan on local branch files
trufflehog3 --no-history --no-entropy --severity MEDIUM -vv -r rules.yml --format json --output truffleHogResults.json || true
# Prepare for result checking
# Check for secrets in the results
CONTENT=$(/opt/homebrew/bin/jq 'length' $ROOT_DIR/truffleHogResults.json)
if [ "$CONTENT" -eq 0 ]; then
rm $ROOT_DIR/truffleHogResults.json
echo "No secrets found. Commit is safe."
exit 0
else
echo "Secrets detected! Commit blocked."
echo "Please review and resolve issues."
exit 1
fi
25 changes: 25 additions & 0 deletions .githooks/pre-push
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/bash
## Set the root directory in the pipeline
ROOT_DIR=$(git rev-parse --show-toplevel)
JS_APP_DIR=benefit-finder

COMMITTED_FILES=$(git diff --name-only HEAD~1..HEAD )

echo $COMMITTED_FILES

# run custom actions for our JS App
for file in $COMMITTED_FILES; do
# Check file extension or content, or run a custom script
echo "Found committed file: $file"
if [[ $file == *$JS_APP_DIR* ]]; then
echo "running processes on committed files"
cd $ROOT_DIR/$JS_APP_DIR && CI=true npm run test:coverage
# check to see if process failed
if [ $? -eq 0 ]; then
echo "Process succeeded."
else
echo "Process failed."
exit 1
fi
fi
done
8 changes: 8 additions & 0 deletions .github/workflows/test-cypress-prod-links.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,14 @@ jobs:
config-file: cypress.prod.links.config.js
working-directory: benefit-finder

- name: Prod Artifact(s)
if: failure()
uses: actions/upload-artifact@v4
with:
name: Prod cypress screenshots
path: ./benefit-finder/cypress/screenshots


- name: create github issue
uses: dacbd/create-issue-action@main
if: failure()
Expand Down
37 changes: 36 additions & 1 deletion .github/workflows/test-cypress.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,13 @@ jobs:
build: "npm run cy:build:storybook"
start: "npm run cy:run:pipeline"

- name: Chrome Artifact(s)
if: failure()
uses: actions/upload-artifact@v4
with:
name: Chrome cypress screenshots
path: ./benefit-finder/cypress/screenshots

tests-firefox:
runs-on: ubuntu-latest
steps:
Expand All @@ -65,6 +72,13 @@ jobs:
build: "npm run cy:build:storybook"
start: "npm run cy:run:pipeline"

- name: Firefox Artifact(s)
if: failure()
uses: actions/upload-artifact@v4
with:
name: Firefox cypress screenshots
path: ./benefit-finder/cypress/screenshots

tests-edge:
runs-on: ubuntu-latest
steps:
Expand All @@ -89,6 +103,13 @@ jobs:
env: NODE_ENV=test
build: "npm run cy:build:storybook"
start: "npm run cy:run:pipeline"

- name: Edge Artifact(s)
if: failure()
uses: actions/upload-artifact@v4
with:
name: Edge cypress screenshots
path: ./benefit-finder/cypress/screenshots

tests-webkit:
runs-on: ubuntu-latest
Expand All @@ -110,7 +131,7 @@ jobs:
uses: cypress-io/github-action@v6
with:
working-directory: ./benefit-finder
build: npx playwright install-deps webkit
build: npx playwright-webkit install-deps
runTests: false

- name: Cypress run (WebKit)
Expand All @@ -123,6 +144,13 @@ jobs:
build: "npm run cy:build:storybook"
start: "npm run cy:run:pipeline"

- name: Webkit Artifact(s)
if: failure()
uses: actions/upload-artifact@v4
with:
name: Webkit cypress screenshots
path: ./benefit-finder/cypress/screenshots

tests-components:
runs-on: ubuntu-latest
steps:
Expand All @@ -147,3 +175,10 @@ jobs:
browser: chrome
env: NODE_ENV=test
build: "npm run cy:prebuild:storybook"

- name: Component Artifact(s)
if: failure()
uses: actions/upload-artifact@v4
with:
name: Component cypress screenshots
path: ./benefit-finder/cypress/screenshots
108 changes: 66 additions & 42 deletions .github/workflows/thog_scan_commit.yml
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
name: TruffleHog Scan

on:
workflow_call:
push:
branches:
- main
- develop
- dev
pull_request:
branches:
- main
- dev

jobs:
scan:
Expand All @@ -17,67 +21,87 @@ jobs:
with:
fetch-depth: 0

- name: Install basic dependancies
run: ./scripts/pipeline/deb-basic-deps.sh

- name: Install AWSCLI
run: ./scripts/pipeline/awscli-install.sh

- name: Install Cloudfoundry CLI
run: ./scripts/pipeline/deb-cf-install.sh

- name: Install GitHub CLI
run: |
sudo apt-get update
sudo apt-get install -y gh

- name: Determine the branch name
id: determine-branch
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BRANCH=${{ github.event.pull_request.head.ref }}" >> $GITHUB_ENV
else
echo "BRANCH=${{ github.ref_name }}" >> $GITHUB_ENV
fi

- name: Authenticate GitHub CLI
env:
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
run: |
gh auth setup-git

- name: Run TruffleHog scan
id: trufflehog_scan
uses: trufflesecurity/[email protected]
with:
base: ""
head: ${{ github.ref_name }}
extra_args: --only-verified --json --entropy --max-depth=50
continue-on-error: true

- name: Check TruffleHog Results
id: check_results
- name: Install TruffleHog3
run: |
if [ -f truffleHogResults.json ]; then
echo "file_exists=true" >> $GITHUB_ENV
else
echo "file_exists=false" >> $GITHUB_ENV
fi

- name: Upload TruffleHog scan results
if: always() && env.file_exists == 'true'
uses: actions/upload-artifact@v3
with:
name: trufflehog-results
path: truffleHogResults.json
pip install trufflehog3

- name: Convert JSON to Readable Report
if: always() && env.file_exists == 'true'
- name: TruffleHog3 Scan
id: scan
run: |
jq -r '.results[] | "File: \(.path)\nCommit: \(.commit)\nDate: \(.date)\nReason: \(.reason)\n---------------------------"' truffleHogResults.json > truffleHogReport.txt
echo "Scanning branch: $BRANCH"
trufflehog3 --branch $BRANCH --no-entropy --severity MEDIUM -vv -c .trufflehog3.yml -r rules.yml --format json --output truffleHogResults.json || true
trufflehog3 -R truffleHogResults.json --output truffleHogReport.html

- name: Upload Readable Report
if: always() && env.file_exists == 'true'
uses: actions/upload-artifact@v3
with:
name: trufflehog-readable-report
path: truffleHogReport.txt
- name: Cloud.gov login
env:
CF_USER: "${{ secrets.CF_USER }}"
CF_PASSWORD: "${{ secrets.CF_PASSWORD }}"
CF_ORG: "${{ secrets.CF_ORG }}"
PROJECT: "${{ secrets.PROJECT }}"
run: |
source ./scripts/pipeline/cloud-gov-login.sh

- name: Check for findings and create issue
if: failure() && env.file_exists == 'true'
- name: Upload Trufflehog Results
id: check_file
shell: bash
env:
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
CF_USER: "${{ secrets.CF_USER }}"
CF_PASSWORD: "${{ secrets.CF_PASSWORD }}"
CF_ORG: "${{ secrets.CF_ORG }}"
PROJECT: "${{ secrets.PROJECT }}"
DATABASE_BACKUP_BASTION_NAME: "${{ secrets.DATABASE_BACKUP_BASTION_NAME }}"
run: |
if jq -e '.results | length > 0' truffleHogResults.json > /dev/null; then
echo "Secrets found. Creating GitHub issue."
gh issue create --title "TruffleHog Scan Results" --body "$(cat truffleHogReport.txt)" --label "bug,security" --assignee "@me"
exit 1
export TIMESTAMP=$(date --utc +%FT%TZ | tr ':', '-')
mv truffleHogResults.json truffleHogResults-${TIMESTAMP}.json
mv truffleHogReport.html truffleHogReport-${TIMESTAMP}.html
source ./scripts/pipeline/s3-thog-upload.sh
CONTENT=$(jq 'length' truffleHogResults-${TIMESTAMP}.json)
if [ "$CONTENT" -eq 0 ]; then
echo "No content found in JSON. Setting Skip to true."
echo "::set-output name=skip::true"
exit 0
else
echo "No secrets found or no results file."
echo "Content found in JSON. Proceeding."
echo "::set-output name=skip::false"
fi

- name: If findings found, create issue
if: steps.check_file.outputs.skip == 'false'
env:
GITHUB_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }}
run: |
echo "Secrets found. Creating GitHub issue."
gh issue create --title "CREDS FOUND: TruffleHog Scan Results" --body "Please see backup s3 for TruffleHog Results" --label "bug,security" --assignee "@me"

- name: Fail the job if any secrets are found
if: steps.trufflehog_scan.outcome == 'failure'
if: steps.check_file.outputs.skip == 'false'
run: exit 1
Empty file.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,4 +55,6 @@ backups/*.sql.gz
**.log

**restore.txt
**backup.txt
**backup.txt
truffleHogResults.json
.venv
22 changes: 22 additions & 0 deletions .trufflehog3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
exclude: # exclude matching issues
- message: Exclude Test Files, False Positives, and Compressed Files.
paths:
- rules.yml
- .trufflehog3.yml
- aws/**
- fake_creds.txt
- truffleHogResults.json
- bears-app/package.json
- .circleci/config.yml
- "**/*.png"
- "**/*.zip"
- "**/*.tar.gz"
- "**/*.deb"
- "**/*.so"
- "**/*.so."
- benefit-finder/storybook-static
- benefit-finder/themes
- benefit-finder/node_modules
- benefit-finder/build
- usagov-2021
- .venv
Loading
Loading