From e313fc8cf869e8693c5f7a7a302d849ad7883e1a Mon Sep 17 00:00:00 2001 From: Kilian von Pflugk Date: Sat, 28 Sep 2024 00:31:16 +0200 Subject: [PATCH] ci: run the valid version step only in public repos --- .github/workflows/release.yml | 1 + validate-and-update-manifest.js | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 54b2752..bf47ddf 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -58,6 +58,7 @@ jobs: env: VERSION: ${{ env.NEW_FILE_VERSION }} GITHUB_REPOSITORY: ${{ github.repository }} + GITHUB_REPO_VISIBILITY: ${{ github.event.repository.visibility }} - name: Commit changes if: success() diff --git a/validate-and-update-manifest.js b/validate-and-update-manifest.js index 2c3840b..6f82421 100644 --- a/validate-and-update-manifest.js +++ b/validate-and-update-manifest.js @@ -5,6 +5,7 @@ const { URL } = require('url'); const repository = process.env.GITHUB_REPOSITORY; const version = process.env.VERSION; +const gitHubRepoVisibilty = process.env.GITHUB_REPO_VISIBILITY let currentVersion = ""; let targetAbi = ""; @@ -42,7 +43,11 @@ async function updateManifest() { checksum: getMD5FromFile(), timestamp: new Date().toISOString().replace(/\.\d{3}Z$/, 'Z') }; - await validVersion(newVersion); + + console.log(`Repo is ${gitHubRepoVisibilty}.`); + if (gitHubRepoVisibilty === 'public') { + await validVersion(newVersion); + } // Add the new version to the manifest jsonData[0].versions.unshift(newVersion);