ci: run the valid version step only in public repos

This commit is contained in:
Kilian von Pflugk 2024-09-28 00:31:16 +02:00
parent e3962a1fc1
commit e313fc8cf8
2 changed files with 7 additions and 1 deletions

View File

@ -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()

View File

@ -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')
};
console.log(`Repo is ${gitHubRepoVisibilty}.`);
if (gitHubRepoVisibilty === 'public') {
await validVersion(newVersion);
}
// Add the new version to the manifest
jsonData[0].versions.unshift(newVersion);