Skip to content

Commit

Permalink
Add Periodic MetalLB Bump workflow
Browse files Browse the repository at this point in the history
This commit adds a new workflow to periodically align
with the upstream MetalLB repository.

This is setup to run daily at 7AM and 7PM, run the make `bump_metallb`
and if differences exist, then open a PR with the bump,
and on the commit message added details on the old commit,
and the new commit, just so it will be easier
for developers to maintain and keep track of changes.

Also deleted the `make test` from the bump_metallb, because we want
the workflow not to fail and to open PR even if the unit tests are
failing, so we could catch and fix that.

Signed-off-by: liornoy <[email protected]>
  • Loading branch information
liornoy committed Apr 16, 2023
1 parent 7b440b4 commit a986206
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions .github/workflows/bump_metallb.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Periodic MetalLB Bump
on:
schedule:
- cron: "0 * * * *"

jobs:
bump-metallb-and-create-pr:
runs-on: ubuntu-latest
Expand All @@ -29,8 +28,8 @@ jobs:
id: new-commit-info
run: |
echo "::set-output name=commit_sha::$(git rev-parse HEAD)"
echo "::set-output name=commit_title::$(git log -1 --pretty=%s)"
echo "::set-output name=commit_date::$(git log -1 --pretty=%cd)"
echo "::set-output name=commit_title::$(git log -1 --pretty=%s HEAD)"
echo "::set-output name=commit_date::$(git log -1 --pretty=%cd HEAD)"
cd ..
- name: Check if there are changes
id: check-for-changes
Expand All @@ -47,16 +46,16 @@ jobs:
make bump_metallb
- name: Create pull request
if: ${{ steps.check-for-changes.outputs.has_changes == 'true'}}
uses: peter-evans/create-pull-request@v4
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
Bump MetalLB
This commit bumps MetalLB from: `${{ steps.old-commit-info.outputs.commit_sha }}`
to: `${{ steps.new-commit-info.outputs.commit_sha }}`.
- Old commit: "${{ steps.old-commit-info.outputs.commit_title }}" (${ steps.old-commit-info.outputs.commit_date }})
- New commit: "${{ steps.new-commit-info.outputs.commit_title }}" (${ steps.new-commit-info.outputs.commit_date }})
- Old commit: "${{ steps.old-commit-info.outputs.commit_title }}" (${{ steps.old-commit-info.outputs.commit_date }})
- New commit: "${{ steps.new-commit-info.outputs.commit_title }}" (${{ steps.new-commit-info.outputs.commit_date }})
author: github-actions[bot] <[email protected]>
committer: github-actions[bot] <[email protected]>
title: "Bump MetalLB"
Expand Down

0 comments on commit a986206

Please sign in to comment.