vsoch · GitHub

This pull request will add a folder, "actions" that has inside a Dockerfile, entrypoint, and instructions for using container-diff within Github Actions. The simplest example is just to run container-diff as part of a workflow:

workflow "Run container-diff isolated" {
  on = "push"
  resolves = ["Run container-diff"]
}
action "Run container-diff" {
  uses = "GoogleContainerTools/container-diff/actions@master"
  args = ["analyze vanessa/salad --type=file --output=/github/workspace/data.json --json"]
}

You could also list the data.json to show it's available for the next step:

workflow "Run container-diff isolated" {
  on = "push"
  resolves = ["list"]
}
action "Run container-diff" {
  uses = "GoogleContainerTools/container-diff/actions@master"
  args = ["analyze vanessa/salad --type=file --output=/github/workspace/data.json --json"]
}
action "list" {
  needs = ["Run container-diff"]
  uses = "actions/bin/sh@master"
  runs = "ls"
  args = ["/github/workspace"]
}

Which is what I did during testing:

image

And the general expectation is that the user would then do some additional step in the workflow that uses the data. For example, I'm going to use it to create an interactive tree diagram of the container (using the --type=file output) and then push it back to github pages.

I don't see need for different kinds or levels of actions (e.g., a subfolder in a repository can have a different Dockerfile or with a different branch) so I made just one actions folder with the Dockerfile at the root, but if you see reason to add specific ones let's chat about that.

Read the original on github.com ↗