-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yml
More file actions
79 lines (76 loc) · 2.63 KB
/
action.yml
File metadata and controls
79 lines (76 loc) · 2.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: 'Nx affected matrix'
branding:
icon: grid
color: white
author: 'e-square.io'
description: "Calculates changes in NX workspace and outputs a JSON that can be used as GitHub's job matrix"
inputs:
targets:
description: 'comma-delimited targets to run'
required: true
default: 'test,build'
args:
description: 'space-delimited args to add to nx command execution'
required: false
maxDistribution:
description: "Maximum distribution of jobs per target"
required: false
default: '3'
maxParallel:
description: "Maximum distribution of jobs per target"
deprecationMessage: "Deprecated. Use maxDistribution instead"
required: false
default: '3'
workingDirectory:
description: "Path to the Nx workspace, needed if not the repository root"
required: false
main-branch:
description: "The 'main' branch of your repository (the base branch which you target with PRs)."
required: false
default: main
workflow-id:
description: "The ID of the github action workflow to check for successful run or the name of the file name containing the workflow."
required: false
checkout:
description: "Should the action do git checkout"
required: false
default: 'true'
debug:
description: "Enable Debug mode"
required: false
default: 'false'
outputs:
matrix:
description: "The matrix that should be used in next job's matrix strategy"
value: ${{ steps.calculate.outputs.matrix }}
apps:
description: "A comma-delimited list of the affected apps"
value: ${{ steps.calculate.outputs.apps }}
libs:
description: "A comma-delimited list of the affected libs (including non buildable libs)"
value: ${{ steps.calculate.outputs.libs }}
hasChanges:
description: "Returns true when there are changes, can be used to skip next steps"
value: ${{ steps.calculate.outputs.hasChanges }}
runs:
using: 'composite'
steps:
- uses: actions/checkout@v2
if: ${{ fromJSON(inputs.checkout) }}
with:
fetch-depth: 0
clean: false
- name: Derive appropriate SHAs for base and head for `nx affected` commands
uses: nrwl/nx-set-shas@v2
with:
main-branch-name: ${{ inputs.main-branch }}
workflow-id: ${{ inputs.workflow-id }}
- name: Calculate affected
id: calculate
uses: actions/github-script@v6
with:
script: |
const { default: setEnv } = require('${{ github.action_path }}/set-env.js');
const { default: main } = require('${{ github.action_path }}/main.js');
setEnv(${{ toJSON(inputs) }}, process);
await main(context, core, __original_require__);