Skip to content

Commit cab3d54

Browse files
committed
Test step output
1 parent 0ee9590 commit cab3d54

File tree

2 files changed

+35
-1
lines changed

2 files changed

+35
-1
lines changed

.github/workflows/check-changeset.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Check Changeset
2+
3+
on: pull_request
4+
5+
jobs:
6+
check_changeset:
7+
name: Check changeset vs changed files
8+
runs-on: ubuntu-latest
9+
10+
steps:
11+
- uses: actions/checkout@v2
12+
- name: Checkout
13+
run: |
14+
git fetch --no-tags --prune --depth=1 origin +refs/heads/*:refs/remotes/origin/*
15+
- name: Set up Node (10)
16+
uses: actions/setup-node@v1
17+
with:
18+
node-version: 10.x
19+
- name: Yarn install
20+
run: yarn
21+
- name: Run changeset script
22+
run: yarn ts-node-script scripts/check_changeset.ts
23+
id: check-changeset
24+
- name: Read output
25+
run: echo env.MISSING_PACKAGES

scripts/check_changeset.ts

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,16 @@ async function main() {
8585
const missingPackages = changedPackages.filter(
8686
changedPkg => !changesetPackages.includes(changedPkg)
8787
);
88-
console.log(missingPackages);
88+
if (missingPackages.length > 0) {
89+
// console.warn(chalk.yellow(`Warning: The following packages were `
90+
// + `changed but not added to the changeset file, make sure this was `
91+
// + `intentional:\n${missingPackages.join('\n')}`));
92+
// process.exit(1);
93+
console.log(
94+
`::set-env name=MISSING_PACKAGES::${missingPackages.join(',')}`
95+
);
96+
}
97+
process.exit();
8998
}
9099
} catch (e) {
91100
console.error(chalk`{red ${e}}`);

0 commit comments

Comments
 (0)