This repository was archived by the owner on Mar 27, 2024. It is now read-only.
This repository was archived by the owner on Mar 27, 2024. It is now read-only.
How to use output from GitHub Action with --output
? #410
Closed
Description
Expected behavior
I'd like to be able to run the GitHub Action for container-diff
using the --output
flag, so I can pass/use the output from the command in other
Actual behavior
Using the action (as in the steps below) triggers:
container-diff diff daemon://my.domain/my/repo:latest daemon://my.domain/my/repo:3401858ca10b2df5cbdb4341b75e4b9051e89722 --type=file --output="container-diff-file.txt
...which gives:
cat: container-diff-file.txt: No such file or directory
Error: Process completed with exit code 1.
Information
- container-diff version:
v0.17.0
(0695621) - Operating system: Linux (via GitHub Actions)
Steps to reproduce the behavior
- Run the GitHub Action for container-diff with the
--output
flag, as per below:
For example:
- name: Run container-diff analyze
if: github.event_name == 'pull_request'
uses: GoogleContainerTools/container-diff/actions@0695621c48497a11a893a8fc0af7965c674123da
with:
command: analyze
args: daemon://${{ env.IMAGE }}:${{ github.sha }} --output="container-diff-analyze.txt"
- name: Publish container-diff analyze
run: |
echo '## `container-diff analyze`' > "${GITHUB_STEP_SUMMARY}"
echo '```' >> "${GITHUB_STEP_SUMMARY}"
cat container-diff-analyze.txt >> "${GITHUB_STEP_SUMMARY}"
echo '```' >> "${GITHUB_STEP_SUMMARY}"
...or...
- name: Pull latest for comparison
if: github.event_name == 'pull_request'
run: docker pull ${{ env.IMAGE }}:latest
- name: Run container-diff diff file
if: github.event_name == 'pull_request'
uses: GoogleContainerTools/container-diff/actions@0695621c48497a11a893a8fc0af7965c674123da
with:
command: diff
args: daemon://${{ env.IMAGE }}:latest daemon://${{ env.IMAGE }}:${{ github.sha }} --type=file --output="container-diff-file.txt"
Other info/context
Back in this PR:
...we added a Dockerfile
for running container-diff
, which may be a contributing factor to the problem and hiding the complexity/errors of using container-diff
like this. It could also just be that I'm not yet understanding what's causing the issue just yet, happy to learn why this kind of issue might occur.
Metadata
Metadata
Assignees
Labels
No labels