Skip to content

Commit 7db1e31

Browse files
dav3rCopilot
andcommitted
Use --fail option with curl and add an explanatory comment
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
1 parent 8f10cb4 commit 7db1e31

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ansible/roles/cyhy_commander/files/run_cyhy_ssvcsync.sh

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,13 @@ set -o pipefail
1414
# Get the recent releases for the cvelistV5 repository from the GitHub REST API.
1515
# Since releases are returned in descending order by creation date, the most
1616
# recent release will be the first one in the list.
17+
#
18+
# Use the --fail option so curl returns a non-zero exit code if the API request
19+
# fails (e.g. due to a network error or a non-2xx HTTP status code), and the
20+
# --silent option to suppress progress output and error messages (since we will
21+
# handle errors ourselves).
1722
RELEASES_JSON=$(
18-
curl --silent --user-agent "cisagov/cyhy_amis/run_cyhy_ssvcsync" \
23+
curl --fail --silent --user-agent "cisagov/cyhy_amis/run_cyhy_ssvcsync" \
1924
"https://api.github.com/repos/CVEProject/cvelistV5/releases"
2025
)
2126

0 commit comments

Comments
 (0)