refactor: start using rules_distroless #10
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Diff Images | |
on: | |
workflow_dispatch: | |
pull_request: | |
branches: ["main"] | |
jobs: | |
diff: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.21' | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
~/.cache/bazel-repo | |
key: bazel-cache-deps-ci1-${{ github.sha }} | |
restore-keys: | | |
bazel-cache-deps-ci1-${{ github.sha }} | |
bazel-cache-deps-ci1- | |
- name: Install Deps | |
run: | | |
go install github.com/google/go-containerregistry/cmd/crane@main | |
go install github.com/reproducible-containers/diffoci/cmd/diffoci@master | |
- name: Diff All Images | |
id: diff | |
run: | | |
./private/diff.bash \ | |
--query-bazel --registry-spawn \ | |
--head-ref ${{ github.head_ref }} \ | |
--base-ref ${{ github.event.pull_request.base.ref }} \ | |
--set-github-output-on-diff \ | |
--report ./report.log | |
- uses: actions/upload-artifact@v4 | |
id: report | |
with: | |
name: "Report" | |
path: "./report.log" | |
- uses: peter-evans/find-comment@v3 | |
id: fc | |
with: | |
issue-number: ${{ github.event.pull_request.number }} | |
comment-author: 'github-actions[bot]' | |
body-includes: 🛎️ Image difference | |
- name: Create or update comment | |
if: ${{ steps.diff.outputs.had_diff }} | |
uses: peter-evans/create-or-update-comment@v4 | |
with: | |
comment-id: ${{ steps.fc.outputs.comment-id }} | |
issue-number: ${{ github.event.pull_request.number }} | |
body: | | |
🛎️ Image difference | |
This pull request has changed the contents of some images. | |
See the report ${{steps.report.outputs.artifact-url}} | |
edit-mode: replace |