Skip to content

Commit ab7a940

Browse files
Merge pull request #665 from step-security/fix/use-policy-store-default-audit
Default to audit mode when api-key missing with use-policy-store
2 parents 9ca718d + ec41b78 commit ab7a940

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

dist/pre/index.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85848,7 +85848,8 @@ var __rest = (undefined && undefined.__rest) || function (s, e) {
8584885848
if (confg.use_policy_store) {
8584985849
console.log(`Fetching policy from policy store`);
8585085850
if (confg.api_key === "") {
85851-
lib_core.setFailed("api-key is required when use-policy-store is set to true");
85851+
lib_core.warning("api-key is not set while use-policy-store is true. Defaulting to audit mode.");
85852+
confg.egress_policy = "audit";
8585285853
}
8585385854
else {
8585485855
try {

dist/pre/index.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/setup.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ interface MonitorResponse {
107107
if (confg.use_policy_store) {
108108
console.log(`Fetching policy from policy store`);
109109
if (confg.api_key === "") {
110-
core.setFailed("api-key is required when use-policy-store is set to true");
110+
core.warning(
111+
"api-key is not set while use-policy-store is true. Defaulting to audit mode."
112+
);
113+
confg.egress_policy = "audit";
111114
} else {
112115
try {
113116
const repoName = (process.env["GITHUB_REPOSITORY"] || "").split("/")[1] || "";

0 commit comments

Comments
 (0)