Skip to content

🔖 Update CHANGELOG.md for [email protected], @fast-check/[email protected], @fast-check/[email protected], @fast-check/[email protected] #96

🔖 Update CHANGELOG.md for [email protected], @fast-check/[email protected], @fast-check/[email protected], @fast-check/[email protected]

🔖 Update CHANGELOG.md for [email protected], @fast-check/[email protected], @fast-check/[email protected], @fast-check/[email protected] #96

Workflow file for this run

name: Safe Release
on:
pull_request:
branches:
- main
- 'next-*_*_*'
- 'fix-v*'
paths:
- '**/CHANGELOG.md'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
safe_release:
name: 'Safe release'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Check no package from workspace
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
const { promises: { readFile } } = require('fs');
const globber = await glob.create('**/package.json');
const files = await globber.glob();
for (const file of files) {
const fileContentRaw = await readFile(file);
const fileContent = JSON.parse(fileContentRaw.toString());
if (fileContent.private) {
continue;
}
for (const depVersion of Object.values(fileContent.dependencies || {})) {
if (depVersion.startsWith('workspace:')) {
throw new Error(`Dependencies cannot start by workspace at release time, got: ${depVersion} in ${file}`);
}
}
for (const depVersion of Object.values(fileContent.peerDependencies || {})) {
if (depVersion.startsWith('workspace:')) {
throw new Error(`Peer-Dependencies cannot start by workspace at release time, got: ${depVersion} in ${file}`);
}
}
}