Skip to content

fix: remove single-dash options from workflows #511

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/workflows/ci-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -60,9 +60,9 @@ jobs:
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -ws -iwr --if-present
run: npm run lint --ignore-scripts --workspaces --include-workspace-root --if-present
- name: Post Lint
run: npm run postlint --ignore-scripts -ws -iwr --if-present
run: npm run postlint --ignore-scripts --workspaces --include-workspace-root --if-present
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
Expand Down Expand Up @@ -140,7 +140,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 --workspaces --include-workspace-root --if-present
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/ci-test-workspace.yml
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@ jobs:
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -w test-workspace
run: npm run lint --ignore-scripts --workspace test-workspace
- name: Post Lint
run: npm run postlint --ignore-scripts -w test-workspace
run: npm run postlint --ignore-scripts --workspace test-workspace

test:
name: Test - ${{ matrix.platform.name }} - ${{ matrix.node-version }}
Expand Down Expand Up @@ -113,4 +113,4 @@ jobs:
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts -w test-workspace
run: npm test --ignore-scripts --workspace test-workspace
2 changes: 1 addition & 1 deletion .github/workflows/post-dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ jobs:
else
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "workspace=-w ${dependabot_dir#/}" >> $GITHUB_OUTPUT
echo "workspace=--workspace ${dependabot_dir#/}" >> $GITHUB_OUTPUT
fi

- name: Apply Changes
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ jobs:
- name: Run Post Pull Request Actions
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: npm run rp-pull-request --ignore-scripts -ws -iwr --if-present -- --pr="${{ needs.release.outputs.pr-number }}" --commentId="${{ needs.release.outputs.comment-id }}"
run: npm run rp-pull-request --ignore-scripts --workspaces --include-workspace-root --if-present -- --pr="${{ needs.release.outputs.pr-number }}" --commentId="${{ needs.release.outputs.comment-id }}"
- name: Commit
id: commit
env:
Expand Down
4 changes: 2 additions & 2 deletions lib/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,8 +160,8 @@ const getFullConfig = async ({
pkgPath,
pkgDir: posixDir(pkgPath),
pkgGlob: posixGlob(pkgPath),
pkgFlags: isWorkspace ? `-w ${pkg.pkgJson.name}` : '',
allFlags: isMono ? '-ws -iwr --if-present' : '',
pkgFlags: isWorkspace ? `--workspace ${pkg.pkgJson.name}` : '',
allFlags: isMono ? '--workspaces --include-workspace-root --if-present' : '',
workspacePaths,
workspaceGlobs: workspacePaths.map(posixGlob),
// type
Expand Down
2 changes: 1 addition & 1 deletion lib/content/post-dependabot-yml.hbs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
else
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "workspace=-w ${dependabot_dir#/}" >> $GITHUB_OUTPUT
echo "workspace=--workspace ${dependabot_dir#/}" >> $GITHUB_OUTPUT
fi

- name: Apply Changes
Expand Down
10 changes: 6 additions & 4 deletions lib/release/release-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ class ReleaseManager {
.replace(/<X\.Y\.Z>/g, release.version)
.replace(/<GITHUB-RELEASE-LINK>/g, release.url)
.replace(/<PUBLISH-FLAGS>/g, release.flags)
.replace(/^(\s*\S.*)(-w <WS-PKG-N>)$/gm, workspaces.map(w => `$1${w.flags}`).join('\n'))
.replace(/^(\s*\S.*)(--workspace <WS-PKG-N>)$/gm, workspaces.map(w => `$1${w.flags}`).join('\n'))
.trim()

return `### Release Checklist for ${release.tag}\n\n${checklist}`
Expand Down Expand Up @@ -150,7 +150,9 @@ class ReleaseManager {
version: rawVersion,
major: version.major,
url: `https://github.com/${pullRequest.base.repo.full_name}/releases/tag/${tag}`,
flags: [workspaces[name] ? `-w ${workspaces[name]}` : null, `--tag=${publishTag}`].filter(Boolean).join(' '),
flags: [workspaces[name] ? `--workspace ${workspaces[name]}` : null, `--tag=${publishTag}`]
.filter(Boolean)
.join(' '),
}
}

Expand Down Expand Up @@ -221,7 +223,7 @@ class ReleaseManager {
1. Publish workspaces

${block('sh')}
npm publish -w <WS-PKG-N>
npm publish --workspace <WS-PKG-N>
${block()}

1. Publish
Expand Down Expand Up @@ -261,7 +263,7 @@ class ReleaseManager {
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.

${block('sh')}
gh run watch ${R} $(gh run list ${R} -w release -b <BASE-BRANCH> -L 1 --json databaseId -q ".[0].databaseId")
gh run watch ${R} $(gh run list ${R} --workspace release -b <BASE-BRANCH> -L 1 --json databaseId -q ".[0].databaseId")
${block()}
`
/* eslint-enable max-len */
Expand Down
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@
"postinstall": "template-oss-apply",
"eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\"",
"prettier": "prettier \"**/*.{js,cjs,ts,mjs,jsx,tsx,json}\"",
"test-all": "npm run test -ws -iwr --if-present",
"lint-all": "npm run lint -ws -iwr --if-present"
"test-all": "npm run test --workspaces --include-workspace-root --if-present",
"lint-all": "npm run lint --workspaces --include-workspace-root --if-present"
},
"repository": {
"type": "git",
Expand Down
50 changes: 25 additions & 25 deletions tap-snapshots/test/apply/source-snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -744,7 +744,7 @@ jobs:
else
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "workspace=-w \${dependabot_dir#/}" >> $GITHUB_OUTPUT
echo "workspace=--workspace \${dependabot_dir#/}" >> $GITHUB_OUTPUT
fi

- name: Apply Changes
Expand Down Expand Up @@ -1906,9 +1906,9 @@ jobs:
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -w a
run: npm run lint --ignore-scripts --workspace a
- name: Post Lint
run: npm run postlint --ignore-scripts -w a
run: npm run postlint --ignore-scripts --workspace a

test:
name: Test - \${{ matrix.platform.name }} - \${{ matrix.node-version }}
Expand Down Expand Up @@ -1960,7 +1960,7 @@ jobs:
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts -w a
run: npm test --ignore-scripts --workspace a

.github/workflows/ci-b.yml
========================================
Expand Down Expand Up @@ -2015,9 +2015,9 @@ jobs:
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -w b
run: npm run lint --ignore-scripts --workspace b
- name: Post Lint
run: npm run postlint --ignore-scripts -w b
run: npm run postlint --ignore-scripts --workspace b

test:
name: Test - \${{ matrix.platform.name }} - \${{ matrix.node-version }}
Expand Down Expand Up @@ -2069,7 +2069,7 @@ jobs:
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts -w b
run: npm test --ignore-scripts --workspace b

.github/workflows/ci-release.yml
========================================
Expand Down Expand Up @@ -2135,9 +2135,9 @@ jobs:
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -ws -iwr --if-present
run: npm run lint --ignore-scripts --workspaces --include-workspace-root --if-present
- name: Post Lint
run: npm run postlint --ignore-scripts -ws -iwr --if-present
run: npm run postlint --ignore-scripts --workspaces --include-workspace-root --if-present
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
Expand Down Expand Up @@ -2206,7 +2206,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 --workspaces --include-workspace-root --if-present
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
Expand Down Expand Up @@ -2430,7 +2430,7 @@ jobs:
else
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "workspace=-w \${dependabot_dir#/}" >> $GITHUB_OUTPUT
echo "workspace=--workspace \${dependabot_dir#/}" >> $GITHUB_OUTPUT
fi

- name: Apply Changes
Expand Down Expand Up @@ -2771,7 +2771,7 @@ jobs:
- name: Run Post Pull Request Actions
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
run: npm run rp-pull-request --ignore-scripts -ws -iwr --if-present -- --pr="\${{ needs.release.outputs.pr-number }}" --commentId="\${{ needs.release.outputs.comment-id }}"
run: npm run rp-pull-request --ignore-scripts --workspaces --include-workspace-root --if-present -- --pr="\${{ needs.release.outputs.pr-number }}" --commentId="\${{ needs.release.outputs.comment-id }}"
- name: Commit
id: commit
env:
Expand Down Expand Up @@ -3068,8 +3068,8 @@ package.json
"snap": "tap",
"test": "tap",
"posttest": "npm run lint",
"test-all": "npm run test -ws -iwr --if-present",
"lint-all": "npm run lint -ws -iwr --if-present"
"test-all": "npm run test --workspaces --include-workspace-root --if-present",
"lint-all": "npm run lint --workspaces --include-workspace-root --if-present"
},
"author": "GitHub Inc.",
"files": [
Expand Down Expand Up @@ -3607,9 +3607,9 @@ jobs:
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -w a
run: npm run lint --ignore-scripts --workspace a
- name: Post Lint
run: npm run postlint --ignore-scripts -w a
run: npm run postlint --ignore-scripts --workspace a

test:
name: Test - \${{ matrix.platform.name }} - \${{ matrix.node-version }}
Expand Down Expand Up @@ -3661,7 +3661,7 @@ jobs:
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts -w a
run: npm test --ignore-scripts --workspace a

.github/workflows/ci-b.yml
========================================
Expand Down Expand Up @@ -3716,9 +3716,9 @@ jobs:
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -w b
run: npm run lint --ignore-scripts --workspace b
- name: Post Lint
run: npm run postlint --ignore-scripts -w b
run: npm run postlint --ignore-scripts --workspace b

test:
name: Test - \${{ matrix.platform.name }} - \${{ matrix.node-version }}
Expand Down Expand Up @@ -3770,7 +3770,7 @@ jobs:
- name: Add Problem Matcher
run: echo "::add-matcher::.github/matchers/tap.json"
- name: Test
run: npm test --ignore-scripts -w b
run: npm test --ignore-scripts --workspace b

.github/workflows/ci-release.yml
========================================
Expand Down Expand Up @@ -3836,9 +3836,9 @@ jobs:
- name: Install Dependencies
run: npm i --ignore-scripts --no-audit --no-fund
- name: Lint
run: npm run lint --ignore-scripts -ws -iwr --if-present
run: npm run lint --ignore-scripts --workspaces --include-workspace-root --if-present
- name: Post Lint
run: npm run postlint --ignore-scripts -ws -iwr --if-present
run: npm run postlint --ignore-scripts --workspaces --include-workspace-root --if-present
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
Expand Down Expand Up @@ -3907,7 +3907,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 --workspaces --include-workspace-root --if-present
- name: Conclude Check
uses: LouisBrunner/checks-action@v1.6.0
if: steps.create-check.outputs.check-id && always()
Expand Down Expand Up @@ -3974,7 +3974,7 @@ jobs:
else
# strip leading slash from directory so it works as a
# a path to the workspace flag
echo "workspace=-w \${dependabot_dir#/}" >> $GITHUB_OUTPUT
echo "workspace=--workspace \${dependabot_dir#/}" >> $GITHUB_OUTPUT
fi

- name: Apply Changes
Expand Down Expand Up @@ -4315,7 +4315,7 @@ jobs:
- name: Run Post Pull Request Actions
env:
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
run: npm run rp-pull-request --ignore-scripts -ws -iwr --if-present -- --pr="\${{ needs.release.outputs.pr-number }}" --commentId="\${{ needs.release.outputs.comment-id }}"
run: npm run rp-pull-request --ignore-scripts --workspaces --include-workspace-root --if-present -- --pr="\${{ needs.release.outputs.pr-number }}" --commentId="\${{ needs.release.outputs.comment-id }}"
- name: Commit
id: commit
env:
Expand Down
4 changes: 2 additions & 2 deletions tap-snapshots/test/check/snapshots.js.test.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -354,8 +354,8 @@ The module file package.json needs to be updated:
"snap": "tap",
"test": "tap",
"posttest": "npm run lint",
"test-all": "npm run test -ws -iwr --if-present",
"lint-all": "npm run lint -ws -iwr --if-present"
"test-all": "npm run test --workspaces --include-workspace-root --if-present",
"lint-all": "npm run lint --workspaces --include-workspace-root --if-present"
}
"tap" is missing, expected {
"test-ignore": "^(workspaces/a|workspaces/b)/",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,6 @@ exports[`test/release/release-manager.js > TAP > mock release manager > must mat
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.

\`\`\`sh
gh run watch -R npm/npm-cli-release-please $(gh run list -R npm/npm-cli-release-please -w release -b main -L 1 --json databaseId -q ".[0].databaseId")
gh run watch -R npm/npm-cli-release-please $(gh run list -R npm/npm-cli-release-please --workspace release -b main -L 1 --json databaseId -q ".[0].databaseId")
\`\`\`
`
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,6 @@ exports[`test/release/release-manager.js > TAP > publish and lockfile > must mat
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.
\`\`\`sh
gh run watch -R npm/node-semver $(gh run list -R npm/node-semver -w release -b main -L 1 --json databaseId -q ".[0].databaseId")
gh run watch -R npm/node-semver $(gh run list -R npm/node-semver --workspace release -b main -L 1 --json databaseId -q ".[0].databaseId")
\`\`\`
`
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,6 @@ exports[`test/release/release-manager.js > TAP > single release > must match sna
Release Please will run on the just pushed release commit and create GitHub releases and tags for each package.

\`\`\`sh
gh run watch -R npm/node-semver $(gh run list -R npm/node-semver -w release -b main -L 1 --json databaseId -q ".[0].databaseId")
gh run watch -R npm/node-semver $(gh run list -R npm/node-semver --workspace release -b main -L 1 --json databaseId -q ".[0].databaseId")
\`\`\`
`
4 changes: 2 additions & 2 deletions test/apply/release.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ t.test('no workspace flags in commands', async t => {
const ciRelease = await s.readFile(join('.github', 'workflows', 'ci-release.yml'))

t.match(ciRelease, '--ignore-scripts\n')
t.notMatch(ciRelease, '--ignore-scripts -ws -iwr --if-present\n')
t.notMatch(ciRelease, '--ignore-scripts --workspaces --include-workspace-root --if-present\n')

const release = await s.readFile(join('.github', 'workflows', 'release.yml'))
t.match(release, '--publish')
Expand All @@ -33,7 +33,7 @@ t.test('uses workspace flags in commands', async t => {
const ciRelease = await s.readFile(join('.github', 'workflows', 'ci-release.yml'))

t.notMatch(ciRelease, '--ignore-scripts\n')
t.match(ciRelease, '--ignore-scripts -ws -iwr --if-present\n')
t.match(ciRelease, '--ignore-scripts --workspaces --include-workspace-root --if-present\n')
})

t.test('backport', async t => {
Expand Down

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/fixtures/nocks/release-please-cases-fix-all.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/fixtures/nocks/release-please-cases-fix-one.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion test/fixtures/nocks/release-please-cases-prerelease.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions test/release/release-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ t.test('repo doesnt exist', async t => {
t.test('workspace names', async t => {
const cwd = t.testdir()
execSync('npm init -y', { cwd })
execSync('npm init -y -w ws1', { cwd })
execSync('npm pkg set name="@npmcli/arborist" -w ws1', { cwd })
execSync('npm init -y -w libnpmdiff', { cwd })
execSync('npm init -y --workspace ws1', { cwd })
execSync('npm pkg set name="@npmcli/arborist" --workspace ws1', { cwd })
execSync('npm init -y --workspace libnpmdiff', { cwd })
t.resolveMatchSnapshot(releaseManager(t, { cwd, pr: 6923, repo: 'npm/cli' }))
})
6 changes: 3 additions & 3 deletions test/release/release-please.js
Original file line number Diff line number Diff line change
Expand Up @@ -82,14 +82,14 @@ t.todo('cases', async t => {
await t.test('fix all', async t => {
const s = setup(t)
before(s)
await matchPr(t, s, { flags: '-ws -iwr', msg: 'fix: update all packages' })
await matchPr(t, s, { flags: '--workspaces --include-workspace-root', msg: 'fix: update all packages' })
await matchReleases(t, s)
})

await t.test('fix one', async t => {
const s = setup(t)
before(s)
await matchPr(t, s, { flags: '-w @npmcli/pkg3', msg: 'fix: update pkg3' })
await matchPr(t, s, { flags: '--workspace @npmcli/pkg3', msg: 'fix: update pkg3' })
await matchReleases(t, s)
})

Expand All @@ -104,7 +104,7 @@ t.todo('cases', async t => {
const s = setup(t)
before(s)
await matchPr(t, s, {
flags: '-ws -iwr',
flags: '--workspaces --include-workspace-root',
msg: 'feat!: update all packages',
prerelease: true,
})
Expand Down