diff --git a/.github/workflows/java-maven-openjdk-dependency-review.yml b/.github/workflows/java-maven-openjdk-dependency-review.yml index d2f80da..d89d659 100644 --- a/.github/workflows/java-maven-openjdk-dependency-review.yml +++ b/.github/workflows/java-maven-openjdk-dependency-review.yml @@ -89,7 +89,7 @@ jobs: owner: owner, repo: repo }); - console.log(`Repository properties: ${response.data}`); + console.log(response.data); const distributedProperty = response.data.find(prop => prop.property_name === 'is_distributed'); const distributedValue = distributedProperty ? distributedProperty.value : 'true'; core.setOutput('is_distributed', distributedValue); diff --git a/.github/workflows/test.js b/.github/workflows/test.js new file mode 100644 index 0000000..5d0eae9 --- /dev/null +++ b/.github/workflows/test.js @@ -0,0 +1,19 @@ +const owner = context.repo.owner; +const repo = context.repo.repo; + +const response = await github.request('GET /repos/{owner}/{repo}/properties/values', { + owner: owner, + repo: repo +}); +console.log(`Repository properties: ${response.data}`); +const distributedProperty = response.data.find(prop => prop.property_name === 'is_distributed'); +const distributedValue = distributedProperty ? distributedProperty.value : 'true'; +core.setOutput('is_distributed', distributedValue); + +const repoDetails = await github.request('GET /repos/{owner}/{repo}', { + owner: owner, + repo: repo +}); +const isPublic = repoDetails.data.private ? 'false' : 'true'; +console.log(`Is this a public repo? ${isPublic}`); +core.setOutput('is_public', isPublic);