Skip to content

Provide a way to output results (--output-file) to a file #455

@onedr0p

Description

@onedr0p

As discussed in Discord, it would be great to have an arg to output to a file. My use case would be to use the new container we built in a Github workflow like this since redirecting to stdout won't work using the container.

      - name: Diff Resources
        uses: docker://ghcr.io/allenporter/flux-local:main
        with:
          args: >
            diff ${{ matrix.resources }}
              --unified 6
              --path-orig live/${{ matrix.paths }}
              --path pr/${{ matrix.paths }}
              --strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart"
              --limit-bytes 10000
              --all-namespaces
              --sources "home-kubernetes"
              --output-file diff.patch

      - name: Generate Diff
        id: diff
        run: |
          echo "diff<<EOF" >> $GITHUB_OUTPUT
          cat diff.patch >> $GITHUB_OUTPUT
          echo "EOF" >> $GITHUB_OUTPUT

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions