Skip to content

Commit

Permalink
fix: update
Browse files Browse the repository at this point in the history
  • Loading branch information
kty1965 committed Feb 14, 2024
1 parent 315d02c commit 0be3a73
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 8 deletions.
9 changes: 5 additions & 4 deletions dist/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -31034,6 +31034,7 @@ const { Octokit } = __nccwpck_require__(5375);
async function getMetaCIDRs({ metadataKey }) {
const octokitRest = new Octokit();
const { data: metadata } = await octokitRest.rest.meta.get();
core.info(`metadataKey: ${metadataKey}`);
core.info(
`Get https://api.github.com/meta GitHub Meta API CIDRs, ${JSON.stringify(
metadata[metadataKey]
Expand All @@ -31042,8 +31043,8 @@ async function getMetaCIDRs({ metadataKey }) {
return metadata[metadataKey];
}

async function getMetaCidrEntries({ octokit, metadataKey }) {
const cidrs = await getMetaCIDRs({ octokit, metadataKey });
async function getMetaCidrEntries({ metadataKey }) {
const cidrs = await getMetaCIDRs({ metadataKey });
const cidrEntries = cidrs.map(
(cidr) =>
new CidrEntry({
Expand Down Expand Up @@ -41498,7 +41499,7 @@ async function run() {
});

if (metadataKey) {
const cidrEntries = await getMetaCidrEntries(octokit, metadataKey);
const cidrEntries = await getMetaCidrEntries({ metadataKey });
if (cidrEntries) {
expectCidrEntries.push(cidrEntries);
} else {
Expand All @@ -41512,7 +41513,7 @@ async function run() {
expectCidrEntries.push(cidrEntries);
}

const toDelete = getToDeleteIpAllowListEntries({
const toDelete = getToCreateIpAllowListEntries({
existScopedIpAllowListEntries,
expectCidrEntries,
});
Expand Down
4 changes: 2 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ async function run() {
});

if (metadataKey) {
const cidrEntries = await getMetaCidrEntries(octokit, metadataKey);
const cidrEntries = await getMetaCidrEntries({ metadataKey });
if (cidrEntries) {
expectCidrEntries.push(cidrEntries);
} else {
Expand All @@ -54,7 +54,7 @@ async function run() {
expectCidrEntries.push(cidrEntries);
}

const toDelete = getToDeleteIpAllowListEntries({
const toDelete = getToCreateIpAllowListEntries({
existScopedIpAllowListEntries,
expectCidrEntries,
});
Expand Down
5 changes: 3 additions & 2 deletions src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ const { Octokit } = require("@octokit/rest");
async function getMetaCIDRs({ metadataKey }) {
const octokitRest = new Octokit();
const { data: metadata } = await octokitRest.rest.meta.get();
core.info(`metadataKey: ${metadataKey}`);
core.info(
`Get https://api.github.com/meta GitHub Meta API CIDRs, ${JSON.stringify(
metadata[metadataKey]
Expand All @@ -13,8 +14,8 @@ async function getMetaCIDRs({ metadataKey }) {
return metadata[metadataKey];
}

export async function getMetaCidrEntries({ octokit, metadataKey }) {
const cidrs = await getMetaCIDRs({ octokit, metadataKey });
export async function getMetaCidrEntries({ metadataKey }) {
const cidrs = await getMetaCIDRs({ metadataKey });
const cidrEntries = cidrs.map(
(cidr) =>
new CidrEntry({
Expand Down

0 comments on commit 0be3a73

Please sign in to comment.