Skip to content

How to export list of directories as JSON to be used in Matrix #1718

Answered by gaby
gaby asked this question in Q&A
Discussion options

You must be logged in to vote

Got it to work now in a cleaner setup. The escape_json has to be set to false for this to work:

Working solution:

jobs:
  detect-changes:
    runs-on: ubuntu-latest
    outputs:
      matrix: ${{ steps.changed-files.outputs.all_changed_files }}
    steps:
      - uses: actions/checkout@v4
        with:
          fetch-depth: 0
      - name: Changed Files
        uses: tj-actions/changed-files@v40
        id: changed-files
        with:
          files_ignore: |
            .github/**
            **.md
          json: true
          escape_json: false
          dir_names: true
          dir_names_exclude_current_dir: true

  gosec-scan:
    runs-on: ubuntu-latest
    needs: detect-changes

Replies: 5 comments 5 replies

Comment options

You must be logged in to vote
2 replies
@jackton1
Comment options

@gaby
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
3 replies
@gaby
Comment options

@gaby
Comment options

@gaby
Comment options

Comment options

You must be logged in to vote
0 replies
Answer selected by gaby
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants