Privacy improvements for CI

This commit is contained in:
mrrfv
2023-05-02 17:55:28 +02:00
parent 99c2930eac
commit c327c5ab42
3 changed files with 4 additions and 4 deletions
+1 -1
View File
@@ -28,7 +28,7 @@ async function getZeroTrustRules() {
if (!filtered_rule) return console.warn("No rule with matching name found - this is not an issue if you haven't run the create script yet. Exiting.");
console.log(`Deleting rule ${filtered_rule.name} with ID ${filtered_rule.id}`);
console.log(`Deleting rule ` + process.env.CI ? "(redacted, running in CI)" : `${filtered_rule.name} with ID ${filtered_rule.id}`);
const resp = await axios.request({
method: 'DELETE',
+2 -2
View File
@@ -75,7 +75,7 @@ fs.readFile('input.csv', 'utf8', async (err, data) => {
await createZeroTrustList(listName, properList, (index+1), listsToCreate);
await sleep(350); // Sleep for 350ms between list additions
} catch (error) {
console.error(`Error creating list "${listName}":`, error.response.data);
console.error(`Error creating list ` + process.env.CI ? "(redacted on CI)" : `"${listName}": ${error.response.data}`);
}
}
});
@@ -119,7 +119,7 @@ async function createZeroTrustList(name, items, currentItem, totalItems) {
);
const listId = response.data.result.id;
console.log(`Created Zero Trust list "${name}" with ID ${listId} - ${totalItems - currentItem} left`);
console.log(`Created Zero Trust list ` + process.env.CI ? "(redacted on CI)" : `"${name}" with ID ${listId} - ${totalItems - currentItem} left`);
}
function percentage(percent, total) {
+1 -1
View File
@@ -31,7 +31,7 @@ async function getZeroTrustLists() {
console.log(`Got ${lists.length} lists, ${cgps_lists.length} of which are CGPS lists that will be deleted.`);
for (const list of cgps_lists) {
console.log(`Deleting list ${list.name} with ID ${list.id}`);
console.log(`Deleting list ` + process.env.CI ? "(redacted, running in CI)" : `${list.name} with ID ${list.id}`);
const resp = await axios.request({
method: 'DELETE',
url: `https://api.cloudflare.com/client/v4/accounts/${ACCOUNT_ID}/gateway/lists/${list.id}`,