-
Notifications
You must be signed in to change notification settings - Fork 205
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Auto run/check security evidence generation in ./fmt.sh (#11407)
CHANGELOG_BEGIN CHANGELOG_END
- Loading branch information
1 parent
c928f0e
commit 03db0aa
Showing
2 changed files
with
34 additions
and
0 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
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,29 @@ | ||
#!/usr/bin/env bash | ||
# Copyright (c) 2021 Digital Asset (Switzerland) GmbH and/or its affiliates. All rights reserved. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
|
||
is_test= | ||
|
||
while [[ $# -gt 0 ]]; do | ||
case "$1" in | ||
--test) | ||
shift | ||
is_test=1 | ||
;; | ||
*) | ||
echo "$0: unknown argument $1" >&2 | ||
exit 1 | ||
;; | ||
esac | ||
done | ||
|
||
# These commands should be run at the root of the repo. | ||
# We write backslash-colon instead of colon ro the grep does not pick up itself. | ||
|
||
if [[ $is_test = 1 ]]; then | ||
git grep --line-number TEST_EVIDENCE\: | bazel run security:evidence-security | diff security-evidence.md - | ||
exit $? | ||
else | ||
git grep --line-number TEST_EVIDENCE\: | bazel run security:evidence-security > security-evidence.md | ||
exit 0 | ||
fi |