diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 86692a4..3c328b7 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -8,6 +8,7 @@ on: jobs: build: + name: "Node ${{ matrix.node-version }}" runs-on: ubuntu-latest @@ -17,13 +18,30 @@ jobs: steps: - uses: actions/checkout@v1 - - name: Use Node.js ${{ matrix.node-version }} - uses: actions/setup-node@v1 + - uses: actions/setup-node@v1 with: node-version: ${{ matrix.node-version }} - name: install dependencies - run: yarn install --non-interactive - - name: lint - run: yarn lint:js - - name: test - run: yarn test + run: yarn install --non-interactive --frozen-lockfile + - run: yarn lint:js + - run: yarn test + + release-it-compat: + name: "release-it@${{ matrix.release-it-version }}" + + runs-on: ubuntu-latest + + strategy: + matrix: + release-it-version: [13, 14] + + steps: + - uses: actions/checkout@v1 + - uses: actions/setup-node@v1 + with: + node-version: 14 + - name: install dependencies + run: yarn install --non-interactive --frozen-lockfile + - run: yarn add --dev release-it@^${{ matrix.release-it-version }} + - run: yarn lint:js + - run: yarn test diff --git a/index.js b/index.js index 22f5a13..9f40bf7 100644 --- a/index.js +++ b/index.js @@ -1,3 +1,5 @@ +'use strict'; + const { EOL } = require('os'); const fs = require('fs'); const which = require('which'); @@ -82,7 +84,7 @@ module.exports = class LernaChangelogGeneratorPlugin extends Plugin { async _launchEditor(tmpFile) { // do not launch the editor for dry runs - if (this.global.isDryRun) { + if (this.config.isDryRun) { return; } @@ -155,7 +157,7 @@ module.exports = class LernaChangelogGeneratorPlugin extends Plugin { } } - if (this.global.isDryRun) { + if (this.config.isDryRun) { this.log.log(`! Prepending ${infile} with release notes.`); } else { let currentFileData = hasInfile ? fs.readFileSync(infile, { encoding: 'utf8' }) : ''; diff --git a/test.js b/test.js index f23b055..20bbe2f 100644 --- a/test.js +++ b/test.js @@ -1,3 +1,5 @@ +'use strict'; + const fs = require('fs'); const path = require('path'); const tmp = require('tmp'); @@ -218,7 +220,7 @@ test('does not launch the editor for dry-run', async (t) => { let plugin = buildPlugin({ infile, launchEditor: `${editor} \${file}` }); - plugin.global.isDryRun = true; + plugin.config.options['dry-run'] = true; await runTasks(plugin);