Skip to content

update g

update g #23

# IWDS Mobile Component Monitor
# Monitors changes to specific files/folders and dispatches the information to
# a serverless function
# See !! comments below for setup
name: 'IWDS Mobile Component Monitor'
on:
push:
branches:
# !! set to the name of the primary branch: 'main' or 'master'
- 'main'
paths:
# !! set to the directory which contains the IWDS components
- 'components/mobile/**'
jobs:
# Gather all changed files into a matrix
changed-files:
name: Get changed files
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.changed-files.outputs.all_changed_files }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get changed files
id: changed-files
uses: tj-actions/changed-files@v41
with:
json: true
quotepath: false
escape_json: false
dir_names: "false"
# !! set path to the directory which contains the IWDS components
path: 'components/mobile/'
files: |
**.js
**.jsx
**.ts
**.tsx
- name: List all changed files
env:
ALL_CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
run: |
echo "All files: $ALL_CHANGED_FILES"
for file in "$ALL_CHANGED_FILES"; do
echo "$file was changed"
done
# report-changes:
# name: Report changed-files
# runs-on: ubuntu-latest
# needs: [changed-files]
# strategy:
# matrix:
# files: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
# max-parallel: 4
# fail-fast: false
# steps:
# - name: LOG
# run: |
# echo ${{ matrix.files }}
report-changes2:
name: Report changed-files
runs-on: ubuntu-latest
needs: [changed-files]
# strategy:
# matrix:
# files: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
# max-parallel: 4
# fail-fast: false
steps:
- name: LOG
env:
MX_OUTPUT: ${{ needs.changed-files.outputs.matrix }}
MX_JSON: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
run: |

Check failure on line 78 in .github/workflows/trigger-mobile.yml

View workflow run for this annotation

GitHub Actions / IWDS Mobile Component Monitor

Invalid workflow file

The workflow is not valid. .github/workflows/trigger-mobile.yml (Line: 78, Col: 14): Unrecognized named-value: 'matrix_data'. Located at position 1 within expression: matrix_data
# echo ${{ matrix.files }}
# files: ${{ fromJSON(needs.changed-files.outputs.matrix) }}
# echo "files: $files"
# filtered=()
# Iterate over each element in the array
# for item in ${{ matrix.files }}; do
# Check if the element matches the pattern
# if [[ contains("$item", '/') ]]; then
# If the element matches the pattern, add it to the filtered array
# filtered+=("$item")
# fi
# echo "Filtered: $filtered"
# matrix_data = ${{ needs.changed-files.outputs.matrix }}
# echo "matrix: $matrix_data"
# for item in ${{ matrix_data }}; do
# echo "got: $item"
echo "mx: $MX_OUTPUT"
echo "JS: $MX_JSON"