|
1 | | -# CHANGE_ME - implement the actual action |
2 | | -name: dummy composite action |
3 | | - |
4 | | -inputs: |
5 | | - input1: |
6 | | - description: value to set to DUMMY_INPUT1 environment variable |
7 | | - input2: |
8 | | - description: value to set to DUMMY_INPUT2 environment variable |
9 | | - |
10 | | -runs: |
11 | | - using: composite |
12 | | - steps: |
13 | | - - name: Dummy step 1 |
14 | | - shell: bash |
15 | | - env: |
16 | | - INPUT1: ${{ inputs.input1 }} |
17 | | - INPUT2: ${{ inputs.input2 }} |
18 | | - run: | |
19 | | - echo "DUMMY_INPUT1=$INPUT1" >> $GITHUB_ENV |
20 | | - echo "DUMMY_INPUT2=$INPUT2" >> $GITHUB_ENV |
| 1 | +name: Setup node build environment |
| 2 | +description: | |
| 3 | + Configure Aikido Safe-Chain and Node environment |
| 4 | +inputs: |
| 5 | + node-version: |
| 6 | + description: 'Version Spec of the version to use. Examples: 12.x, 10.15.1, >=10.15.0.' |
| 7 | + node-version-file: |
| 8 | + description: 'File containing the version Spec of the version to use. Examples: package.json, .nvmrc, .node-version, .tool-versions.' |
| 9 | + architecture: |
| 10 | + description: 'Target architecture for Node to use. Examples: x86, x64. Will use system architecture by default.' |
| 11 | + check-latest: |
| 12 | + description: 'Set this option if you want the action to check for the latest available version that satisfies the version spec.' |
| 13 | + default: false |
| 14 | + registry-url: |
| 15 | + description: 'Optional registry to set up for auth. Will set the registry in a project level .npmrc and .yarnrc file, and set up auth to read in from env.NODE_AUTH_TOKEN.' |
| 16 | + scope: |
| 17 | + description: 'Optional scope for authenticating against scoped registries. Will fall back to the repository owner when using the GitHub Packages registry (https://npm.pkg.github.com/).' |
| 18 | + token: |
| 19 | + description: Used to pull node distributions from node-versions. Since there's a default, this is typically not supplied by the user. When running this action on github.com, the default value is sufficient. When running on GHES, you can pass a personal access token for github.com if you are experiencing rate limiting. |
| 20 | + default: ${{ github.server_url == 'https://github.com' && github.token || '' }} |
| 21 | + cache: |
| 22 | + description: 'Used to specify a package manager for caching in the default directory. Supported values: npm, yarn, pnpm.' |
| 23 | + package-manager-cache: |
| 24 | + description: 'Set to false to disable automatic caching. By default, caching is enabled when either devEngines.packageManager or the top-level packageManager field in package.json specifies npm as the package manager.' |
| 25 | + default: true |
| 26 | + cache-dependency-path: |
| 27 | + description: 'Used to specify the path to a dependency file: package-lock.json, yarn.lock, etc. Supports wildcards or a list of file names for caching multiple dependencies.' |
| 28 | + mirror: |
| 29 | + description: 'Used to specify an alternative mirror to downlooad Node.js binaries from' |
| 30 | + mirror-token: |
| 31 | + description: 'The token used as Authorization header when fetching from the mirror' |
| 32 | +outputs: |
| 33 | + cache-hit: |
| 34 | + description: 'A boolean value to indicate if a cache was hit.' |
| 35 | + value: ${{ steps.setup-node.outputs.cache-hit }} |
| 36 | + node-version: |
| 37 | + description: 'The installed node version.' |
| 38 | + value: ${{ steps.setup-node.outputs.node-version }} |
| 39 | + |
| 40 | + |
| 41 | +runs: |
| 42 | + using: composite |
| 43 | + steps: |
| 44 | + - name: Setup Node.js |
| 45 | + id: setup-node |
| 46 | + uses: actions/setup-node@2028fbc5c25fe9cf00d9f06a71cc4710d4507903 # v6.0.0 |
| 47 | + with: |
| 48 | + node-version: ${{ inputs.node-version }} |
| 49 | + node-version-file: ${{ inputs.node-version-file }} |
| 50 | + architecture: ${{ inputs.architecture }} |
| 51 | + check-latest: ${{ inputs.check-latest }} |
| 52 | + registry-url: ${{ inputs.registry-url }} |
| 53 | + scope: ${{ inputs.scope }} |
| 54 | + token: ${{ inputs.token }} |
| 55 | + cache: ${{ inputs.cache }} |
| 56 | + package-manager-cache: ${{ inputs.package-manager-cache }} |
| 57 | + cache-dependency-path: ${{ inputs.cache-dependency-path }} |
| 58 | + mirror: ${{ inputs.mirror }} |
| 59 | + mirror-token: ${{ inputs.mirror-token }} |
| 60 | + - name: Setup Aikido Safe-Chain |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + npm i -g @aikidosec/safe-chain |
| 64 | + safe-chain setup-ci |
0 commit comments