Crawlee—A web scraping and browser automation library for Node.js to build reliable crawlers. In JavaScript and TypeScript. Extract data for AI, LLMs, RAG, or GPTs. Download HTML, PDF, JPG, PNG, and other files from websites. Works with Puppeteer, Playwright, Cheerio, JSDOM, and raw HTTP. Both headful and headless mode. With proxy rotation.
TypeScript apifyautomationcrawlercrawlingheadlessheadless-chromejavascriptnodejsnpmplaywrightpuppeteerscraperscrapingtypescriptweb-crawlerweb-crawlingweb-scraping
Add validation to release script
Ondra Urbanc6f7d12741a9
diff --git a/tools/release.js b/tools/release.jsindex 1c5a39dec..8d14a3112 100644--- a/tools/release.js+++ b/tools/release.js@@ -6,14 +6,26 @@ const semver = require('semver'); // eslint-disable-line import/no-extraneous-deconst VERSION = require('../package.json').version;log('Checking if current branch is master branch.');-const currentBranch = execSync('git branch | grep "*"', { encoding: 'utf8' }).substr(2);-if (currentBranch !== 'master') {- log('Release can only be triggered from the master branch.');+const gitStatus = execSync('git status --porcelain --branch', { encoding: 'utf8' });+if (!gitStatus.startsWith('## feature/')) { // TODO for testing, dont forget to replace+ log('Release can only be triggered from the master branch. Please checkout master.');+ process.exit(1);+}++log('Checking if all changes are committed.');+const statusLines = gitStatus.split('\n');+if (statusLines.length > 1 && statusLines[1].length) {+ log('You have uncommitted changes. Please commit them and run the script again.');process.exit(1);}log('Checking if branch is up to date.');-const upToDate = execSync('git branch | grep "*"', { encoding: 'utf8' }).substr(2);+if (/\[ahead|behind \d+\]/.test(gitStatus)) {+ log('Your local copy of master branch is not up to date with the remote. Please push / pull changes.');+ process.exit(1);+}++log('Fetching version of published beta.');const betaVersion = fetchPackageJsonPropertyForTag('version', 'beta');