Set Default Output for a Job?

I have the following yml file, which uses dorny/paths-filter.

The paths filter sets jobs.changedFiles.outputs.locales to a string array of the keys based on what files have changed (if AU and GB files change, it will output '[AU, GB]'.

What I would like to do is if the filter output is an empty array ('[]'), I want to set jobs.changedFiles.outputs.locales to use all the keys ('[DE, AU, FR, GB]'). This way snapshots.matrix.locale will be set to an array of all those keys.

  1. How can I get all the keys from with.filters? (Hoping for something like with.filters.keys)
  2. How can I set the default output for changedFiles.outputs.locales?
    • I have seen how to set an output but that only seems to set it for an individual step, not an entire job
name: Snapshot Tests - Non-US
on:
    push:
        branches:
            - develop
            - release
        paths:
            # Generic
            - banners/**
    pull_request:
        paths:
            # Generic
            - banners/**
jobs:
    changedFiles:
        name: Get Changed Locales
        runs-on: ubuntu-latest
        outputs:
            locales: ${{ steps.filter.outputs.changes }}
        steps:
            - name: Checkout repo
              uses: actions/checkout@v2

            - name: Filter locale paths
              uses: dorny/paths-filter@v2
              id: filter
              with:
                  # DE is first since it takes the longest
                  filters: |
                      DE: '**/DE/**'
                      AU: '**/AU/**'
                      FR: '**/FR/**'
                      GB: '**/GB/**'

            # if none of the filter paths match,
            # another file or multiple files were changed that affect all locales
            - name: Set paths to all locales if none were filtered
              if: steps.filter.outputs.locales == '[]'
              run: # SET LOCALES OUTPUT HERE TO [DE, AU, FR, GB]

    snapshots:
        name: Non-US Snapshots
        runs-on: ubuntu-latest
        needs: changedFiles
        strategy:
            matrix:
                locale: ${{ fromJSON(needs.changedFiles.outputs.locales) }}
                node: [12]
        steps:
            - name: Non-US Snapshot Tests - ${{ matrix.locale }}
              run: |
                  npm run test:func -- --testPathPattern spec/${{ matrix.locale }}
                  ./scripts/snapshot-tests/collect-diffs.sh