Skip to content

Commit

Permalink
Merge to v4 2024 05 15 (#53)
Browse files Browse the repository at this point in the history
feat: get json data read from file
feat: jq action wrapper for 'jq' CLI utility
feat: add hashfile-search-path for node cache
merge v4-beta to v4
---------

Co-authored-by: Korenevskiy Denis <[email protected]>
  • Loading branch information
mike-ainsel and DenKoren authored May 15, 2024
1 parent 16b8a07 commit 730c6b0
Show file tree
Hide file tree
Showing 4 changed files with 49 additions and 4 deletions.
32 changes: 32 additions & 0 deletions actions/git/repository-dispatch/action.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Repository Dispatch
author: 'MiLaboratories'
description: |
Create a repository dispatch event
See original action peter-evans/repository-dispatch/
inputs:
token:
description: 'GITHUB_TOKEN or a `repo` scoped Personal Access Token (PAT)'
default: ${{ github.token }}
repository:
description: 'The full name of the repository to send the dispatch.'
default: ${{ github.repository }}
event-type:
description: 'A custom webhook event name.'
required: true
client-payload:
description: 'JSON payload with extra information about the webhook event that your action or worklow may use.'
default: '{}'

runs:
using: "composite"

steps:
- name: Repository Dispatch
uses: peter-evans/repository-dispatch@ff45666b9427631e3450c54a1bcbee4d9ff4d7c0
with:
token: ${{ inputs.token }}
repository: ${{ inputs.repository }}
event-type: ${{ inputs.event-type }}
client-payload: ${{ inputs.client-payload }}
2 changes: 1 addition & 1 deletion actions/helpers/jq/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ runs:

steps:
- id: jq
uses: milaboratory/github-ci/actions/shell@v4-beta
uses: milaboratory/github-ci/actions/shell@v4
env:
INPUT_FILE: ${{ inputs.file }}
JQ_SELECT: ${{ inputs.select }}
Expand Down
12 changes: 9 additions & 3 deletions actions/node/cache/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,12 @@ inputs:
required: false
default: 'true'

hashfiles-search-path:
description: |
Hashfiles search path for package-lock.json
required: false
default: '**/package-lock.json'

runs:
using: "composite"

Expand All @@ -37,7 +43,7 @@ runs:
path: |
~/.cache/electron/
~/Library/Caches/electron/
key: ${{ runner.OS }}-cache-${{ inputs.cache-version }}-electron-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.OS }}-cache-${{ inputs.cache-version }}-electron-${{ hashFiles(inputs.hashfiles-search-path) }}
restore-keys: |
${{ runner.OS }}-cache-${{ inputs.cache-version }}-electron-
Expand All @@ -46,7 +52,7 @@ runs:
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-cache-${{ inputs.cache-version }}-node_modules-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.OS }}-cache-${{ inputs.cache-version }}-node_modules-${{ hashFiles(inputs.hashfiles-search-path) }}
restore-keys: |
${{ runner.OS }}-cache-${{ inputs.cache-version }}-node_modules-
Expand All @@ -55,6 +61,6 @@ runs:
if: inputs.is-electron-application == 'false'
with:
path: ~/.npm
key: ${{ runner.OS }}-cache-${{ inputs.cache-version }}-genericnodejs-${{ hashFiles('**/package-lock.json') }}
key: ${{ runner.OS }}-cache-${{ inputs.cache-version }}-genericnodejs-${{ hashFiles(inputs.hashfiles-search-path) }}
restore-keys: |
${{ runner.OS }}-cache-${{ inputs.cache-version }}-genericnodejs-
7 changes: 7 additions & 0 deletions actions/node/prepare/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,12 @@ inputs:
required: false
default: 'v1'

hashfiles-search-path:
description: |
Hashfiles search path for package-lock.json
required: false
default: '**/package-lock.json'

is-electron-application:
description: |
If 'true' enables cache for an Electron application,
Expand Down Expand Up @@ -62,5 +68,6 @@ runs:
uses: milaboratory/github-ci/actions/node/cache@v4
with:
is-electron-application: ${{ inputs.is-electron-application }}
hashfiles-search-path: ${{ inputs.hashfiles-search-path }}
cache-version: ${{ inputs.cache-version }}
local-cache: 'on'

0 comments on commit 730c6b0

Please sign in to comment.