paths-filter icon indicating copy to clipboard operation
paths-filter copied to clipboard

Why is outputs []?

Open BjarkeMeier opened this issue 4 years ago • 2 comments

Here is an example where the outputs appears to be an empty array. I expected it to be an object with a functionhost property with value false as there are no changes to any file in the filter.

image

Screendump of the workflow: image

So the guard in line 60 apparently doesn't work as expected. Am I missing something?

BjarkeMeier avatar Oct 12 '21 11:10 BjarkeMeier

image

image

Since our filters look like:


      - uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
        id: filter
        with:
          ref: master
          filters: |
            Changesets:
              - added: '.changesets/!(README)*.md'

            Apps:
              - 'apps/!(*storybook)**/*'

            AppStorybook:
              - 'apps/**'
              - 'apps/storybook/**'

            Balance:
              - 'design-system/**'

            Infrastructure:
              - 'infrastructure/**'

I'd expect that our needs.Changes.outputs.Changesets == 'true'

but :

image


name: Mainline

# Mainline Workflow
#
# Intention:
#  - process changesets (CHANGELOG and version calculations)
#  - deploy App Storybook (if needed)
#  - deploy Balance Website (if needed)
#  - deploy Apps (if needed)
#  - update computed workflows based on repo state

'on':
  push:
    branches:
      - master
      - test/master

concurrency:
  group: ${{ github.workflow }}-${{ github.ref }}

env:
  NODE_OPTIONS: --max-old-space-size=8096

jobs:
  Changes:
    runs-on: ubuntu-latest

    outputs:
      changes: ${{ steps.filter.outputs.changes }}
      Apps: ${{ steps.filter.outputs.Apps }}
      AppStorybook: ${{ steps.filter.outputs.AppStorybook }}
      Changesets: ${{ steps.filter.outputs.Changesets }}
      Balance: ${{ steps.filter.outputs.Balance }}
      Infrastructure: ${{ steps.filter.outputs.Infrastructure }}

    steps:
      #
      # Not on a Pull Request, so dorny/paths-filter needs a checkout
      #
      - uses: actions/checkout@v3
        with:
          # This may save additional git fetch roundtrip
          fetch-depth: 0

      - run: git fetch origin master:master
        if: github.ref_name != 'master'

      #
      # Build a list of namespace change flags
      #
      - uses: dorny/paths-filter@b2feaf19c27470162a626bd6fa8438ae5b263721
        id: filter
        with:
          ref: master
          filters: |
            Changesets:
              - added: '.changesets/!(README)*.md'

            Apps:
              - 'apps/!(*storybook)**/*'

            AppStorybook:
              - 'apps/**'
              - 'apps/storybook/**'

            Balance:
              - 'design-system/**'

            Infrastructure:
              - 'infrastructure/**'

      - run: node -e 'console.log(${{toJson(steps.filter.outputs)}})'

  Changesets:
    runs-on: ubuntu-latest
    permissions:
      contents: write
      deployments: write
    needs: Changes
    if: needs.Changes.outputs.Changesets == 'true'
    steps:
      - uses: actions/checkout@v3
        with:
          # this sets up the git connection string for the pull
          # and any further pushes. Important, because this particular
          # step requires a token with certain scopes to modify items in the
          # .github/workflows directory.
          token: ${{secrets.RECKON_BOT_TOKEN}}

      - name: Provision
        uses: ./packages/tools/action-setup-tooling
        with:
          SetupCommand: ./setup.bash

      - name: Install Deps
        uses: ./packages/tools/action-setup-pnpm

      - name: Set Reckonbot as Author
        uses: ./packages/tools/action-setup-repobot
        with:
          Email: ${{secrets.RECKON_BOT_GIT_EMAIL}}
          Name: ${{secrets.RECKON_BOT_GIT_NAME}}

      #
      # Process Changesets
      #
      # If the pushed ref is a branch and that branch name is 'master',
      # and the commit message doesnt look like it was created by processing changesets
      # then lets try processing any changsets.
      - name: Process changesets
        uses: ./packages/tools/action-process-changesets

airtonix avatar Aug 31 '22 01:08 airtonix

nvm i'm stupid... it was a typo.

actualy path: .changeset/ in my filter: .changesets/!(README)*.md

🤦🏻‍♂️

airtonix avatar Aug 31 '22 01:08 airtonix