Skip to content

Commit

Permalink
Read commit ref from file
Browse files Browse the repository at this point in the history
This commit moves the metallb commit ref to
hack/metallb_ref.txt and thus we don't need a
special token with extra permissions.
  • Loading branch information
liornoy committed May 8, 2023
1 parent 5f6fe4a commit db2e2cd
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/bump_metallb.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: Periodic MetalLB Bump
on:
schedule:
- cron: "0 1 * * *"
- cron: "*/5 * * * *"
jobs:
bump-metallb-and-create-pr:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:
if: ${{ steps.check-for-changes.outputs.has_changes == 'true'}}
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.PAT }}
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: |
Bump MetalLB
Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/metallb_e2e.yml
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,17 @@ jobs:
run: |
make manifests
git diff --exit-code
- name: Read metallb ref
id: metallb_ref
uses: juliangruber/read-file-action@v1
with:
path: ./hack/metallb_ref.txt
- name: Checkout MetalLB
uses: actions/checkout@v2
with:
repository: metallb/metallb
path: metallb
ref: 1424dbaef1313b8bb20df136e8eacd2dbacdae02
ref: "${{ steps.metallb_ref.outputs.content }}"
- name: Checkout MetalLB v0.12
uses: actions/checkout@v2
with:
Expand Down
2 changes: 1 addition & 1 deletion hack/bump_metallb.sh
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/bash

HASH=`git ls-remote https://github.com/metallb/metallb | grep refs/heads/main | cut -f 1`
sed -i "s/export METALLB_COMMIT_ID=.*/export METALLB_COMMIT_ID=\"$HASH\"/g" hack/common.sh
echo $HASH > hack/metallb_ref.txt
2 changes: 1 addition & 1 deletion hack/common.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export PATH=$PATH:$GOPATH/bin

mkdir -p _cache

export METALLB_COMMIT_ID="1424dbaef1313b8bb20df136e8eacd2dbacdae02"
export METALLB_COMMIT_ID=$(cat hack/metallb_ref.txt)
export METALLB_PATH=_cache/metallb

export METALLB_SC_FILE=$(dirname "$0")/securityContext.yaml
Expand Down
3 changes: 0 additions & 3 deletions hack/generate-metallb-manifests.sh
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,6 @@ curl ${FRR_MANIFESTS_URL} -o _cache/${FRR_MANIFESTS_FILE}
# Generate metallb-frr rbac manifests
yq e '. | select(.kind == "Role" or .kind == "ClusterRole" or .kind == "RoleBinding" or .kind == "ClusterRoleBinding" or .kind == "ServiceAccount")' _cache/${FRR_MANIFESTS_FILE} > config/metallb_rbac/${FRR_MANIFESTS_FILE}

# Update MetalLB's E2E lane to clone the same commit as the manifests.
yq e --inplace ".jobs.main.steps[] |= select(.name==\"Checkout MetalLB\").with.ref=\"${METALLB_COMMIT_ID}\"" .github/workflows/metallb_e2e.yml

fetch_metallb

# we want to preserve the metallb crd
Expand Down
1 change: 1 addition & 0 deletions hack/metallb_ref.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1424dbaef1313b8bb20df136e8eacd2dbacdae02

0 comments on commit db2e2cd

Please sign in to comment.