Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 17 additions & 8 deletions .github/workflows/supply-chain-pins.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
# - on a branch named supply-chain-pins*: commits the pins to that branch
# - on a Dependabot pull request: refreshes the lockfile and checksums for the new versions, so
# the update passes verification
# - weekly and on demand: opens a pull request if anything is unpinned
# - weekly and on demand (main): reports anything unpinned in the run's summary, and changes
# nothing: updates reach main through the Valxel tool (GitHub's alerts; a hotfix or a release)
name: supply-chain-pins
on:
push:
Expand All @@ -12,8 +13,7 @@ on:
workflow_dispatch:
schedule: [{ cron: "17 6 * * 1" }]
permissions:
contents: write
pull-requests: write
contents: write # a Dependabot or supply-chain-pins* branch only
concurrency:
group: pins-${{ github.head_ref || github.ref }}
cancel-in-progress: true
Expand Down Expand Up @@ -41,18 +41,27 @@ jobs:
./gradlew --no-daemon -q --write-locks --write-verification-metadata sha256 dependencies build -x test
- name: Commit
env:
GH_TOKEN: ${{ github.token }}
REF: ${{ github.head_ref || github.ref_name }}
run: |
git add -A
git diff --cached --quiet && { echo "nothing to pin"; exit 0; }
git -c user.name="valxel-pins" -c user.email="valxel-pins@users.noreply.github.com" \
commit -q -m "Pin base images, dependencies and their checksums"
if [ "$REF" = "main" ]; then
branch="supply-chain-pins-$(date +%Y%m%d)"
git push -q origin "HEAD:refs/heads/$branch"
gh pr create --head "$branch" --title "Pin base images and dependencies" \
--body "Base images pinned to their digests, and (Gradle) dependencies locked with checksums, by supply-chain-pins."
# Main isn't changed from here and no pull request is opened: dependency and vulnerability
# updates reach products through the Valxel tool (GitHub's alerts, a hotfix or the next
# release). What would change is listed in the run's summary.
{
echo "### Not pinned on main"
echo
echo "supply-chain-pins found these out of date; it changes nothing on main."
echo
echo '```'
git show --stat --format= HEAD
git show --format= HEAD -- '*.lockfile' 'Dockerfile*' | grep '^[-+][^-+]' | head -40
echo '```'
} >> "$GITHUB_STEP_SUMMARY"
echo "::notice title=supply-chain-pins::Out of date on main; see the run summary (nothing pushed)"
else
git push -q origin "HEAD:$REF"
fi