find-cypress-specs 1.40.0 → 1.41.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +5 -1
  2. package/bin/find.js +11 -0
  3. package/package.json +2 -2
package/README.md CHANGED
@@ -40,7 +40,7 @@ $ npx find-cypress-specs --branch main
40
40
 
41
41
  ## set GitHub Actions outputs
42
42
 
43
- If you add `--set-gh-outputs` command line switch, then the number of changed specs and the comma-separated file list will be set as GH Actions outputs `changedSpecsN` and `changedSpecs`. See [pr.yml](./.github/workflows/pr.yml) for example
43
+ If you add `--set-gha-outputs` command line switch, then the number of changed specs and the comma-separated file list will be set as GH Actions outputs `changedSpecsN` and `changedSpecs`. See [pr.yml](./.github/workflows/pr.yml) for example
44
44
 
45
45
  ```yml
46
46
  - name: Print specs changed against the parent of this branch 🌳
@@ -52,6 +52,10 @@ If you add `--set-gh-outputs` command line switch, then the number of changed sp
52
52
  run: echo ${{ steps.step1.outputs.changedSpecsN }} ${{ steps.step1.outputs.changedSpecs }}
53
53
  ```
54
54
 
55
+ ## Write GitHub Actions job summary
56
+
57
+ You can output changes specs by using the parameter `--gha-summary`
58
+
55
59
  ## against the parent commit
56
60
 
57
61
  When dealing with a long-term branch, you do not want to see the changed files in the main branch. Instead, you want to only consider the specs changed in the _current_ branch all the way to its parent commit. You can pass the flag `--parent` to only pick the modified and added specs.
package/bin/find.js CHANGED
@@ -38,6 +38,8 @@ const args = arg({
38
38
  // to set two named outputs, one for number of changed specs
39
39
  // another for actual list of files
40
40
  '--set-gha-outputs': Boolean,
41
+ // print a summary to the GitHub Actions job summary
42
+ '--gha-summary': Boolean,
41
43
  // save a JSON file with traced dependencies to save time
42
44
  '--cache-trace': Boolean,
43
45
  '--time-trace': Boolean,
@@ -193,6 +195,15 @@ if (args['--test-counts']) {
193
195
  core.setOutput('changedSpecsN', changedSpecs.length)
194
196
  core.setOutput('changedSpecs', changedSpecs.join(','))
195
197
  }
198
+ if (args['--gha-summary']) {
199
+ debug('writing GitHub Actions summary')
200
+ const summary = `Found that ${pluralize(
201
+ 'spec',
202
+ changedSpecs.length,
203
+ true,
204
+ )} changed: ${changedSpecs.join(', ')}`
205
+ core.summary.addRaw(summary).write
206
+ }
196
207
 
197
208
  if (args['--count']) {
198
209
  console.log(changedSpecs.length)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "find-cypress-specs",
3
- "version": "1.40.0",
3
+ "version": "1.41.1",
4
4
  "description": "Find Cypress spec files using the config settings",
5
5
  "main": "src",
6
6
  "files": [
@@ -75,7 +75,7 @@
75
75
  "pluralize": "^8.0.0",
76
76
  "require-and-forget": "^1.0.1",
77
77
  "shelljs": "^0.8.5",
78
- "spec-change": "^1.9.0",
78
+ "spec-change": "^1.10.0",
79
79
  "ts-node": "^10.9.1"
80
80
  }
81
81
  }