Skip to content

Commit

Permalink
fix: dont use -ws flags in release workflow when not necessary (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukekarrys authored Oct 5, 2022
1 parent f6a0268 commit b313218
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,7 @@ jobs:
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts -ws -iwr --if-present
run: npm test --ignore-scripts --if-present
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.3.1
if: always()
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,7 @@ jobs:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
npm exec --offline -- template-oss-release-manager
npm run rp-pull-request --ignore-scripts -ws -iwr --if-present
npm run rp-pull-request --ignore-scripts --if-present
- name: Commit
id: commit
env:
Expand Down
2 changes: 1 addition & 1 deletion lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ const getFullConfig = async ({
pkgDir: posixDir(pkgPath),
pkgGlob: posixGlob(pkgPath),
pkgFlags: isRoot ? '-iwr' : `-w ${pkgJson.name}`,
allFlags: '-ws -iwr --if-present',
allFlags: `${workspaces.length ? '-ws -iwr' : ''} --if-present`.trim(),
workspacePaths,
workspaceGlobs: workspacePaths.map(posixGlob),
// booleans to control application of updates
Expand Down
4 changes: 2 additions & 2 deletions tap-snapshots/test/apply/source-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ jobs:
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts -ws -iwr --if-present
run: npm test --ignore-scripts --if-present
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.3.1
if: always()
Expand Down Expand Up @@ -873,7 +873,7 @@ jobs:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
run: |
npm exec --offline -- template-oss-release-manager
npm run rp-pull-request --ignore-scripts -ws -iwr --if-present
npm run rp-pull-request --ignore-scripts --if-present
- name: Commit
id: commit
env:
Expand Down
27 changes: 27 additions & 0 deletions test/apply/release.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
const t = require('tap')
const { join } = require('path')
const setup = require('../setup.js')

t.test('no workspace flags in commands', async (t) => {
const s = await setup(t)
await s.apply()

const release = await s.readFile(join('.github', 'workflows', 'release.yml'))

t.match(release, '--ignore-scripts --if-present\n')
t.notMatch(release, '--ignore-scripts -ws -iwr --if-present\n')
})

t.test('uses workspace flags in commands', async (t) => {
const s = await setup(t, {
workspaces: {
a: 'a',
},
})
await s.apply()

const release = await s.readFile(join('.github', 'workflows', 'release.yml'))

t.notMatch(release, '--ignore-scripts --if-present\n')
t.match(release, '--ignore-scripts -ws -iwr --if-present\n')
})

0 comments on commit b313218

Please sign in to comment.