Add README badge with libyear count

The above is done with the help of a new pipeline step. It uses libyear to calculate how outdated each dependency (including indirect) is.
Then, it uses a Github Action called "Bring Your Own Badge". This action commits the count made by libyear to a "shields" branch. This is count is later referenced in the project's README.

Signed-off-by: João Henri <joao.henri.cr@gmail.com>
This commit is contained in:
João Henri 2023-01-02 16:46:35 -03:00
parent 2ea010986f
commit 3c0856a576

View file

@ -319,7 +319,7 @@ jobs:
kind get kubeconfig > $HOME/.kube/kind-config-kind
make kind-e2e-test
- name: Uplaod e2e junit-reports
- name: Upload e2e junit-reports
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
if: success() || failure()
with:
@ -374,7 +374,7 @@ jobs:
kind get kubeconfig > $HOME/.kube/kind-config-kind
make kind-e2e-test
- name: Uplaod e2e junit-reports
- name: Upload e2e junit-reports
uses: actions/upload-artifact@83fd05a356d7e2593de66fc9913b3002723633cb # v3.1.1
if: success() || failure()
with:
@ -492,3 +492,38 @@ jobs:
if: ${{ steps.filter-images.outputs.kube-webhook-certgen == 'true' }}
run: |
cd images/kube-webhook-certgen && make test test-e2e
libyear:
runs-on: ubuntu-latest
permissions:
contents: write
pull-requests: write # for RubbaBoy/BYOB to write to "shields" branch
steps:
- name: Checkout
uses: actions/checkout@755da8c3cf115ac066823e79a1e1788f8940201b # v3.2.0
- name: Set up Go
id: go
uses: actions/setup-go@6edd4406fa81c3da01a34fa6f6343087c207a568 # v3.5.0
with:
go-version: '1.19'
check-latest: true
- name: Install libyear
run: go install git.yetaga.in/alazyreader/libyear@latest
- name: Run libyear
id: libyear
run: |
LIBYEAR_COUNT=$(libyear -indirect | tail -1 | sed -e "s/total libyear count: //")
echo "LIBYEAR_COUNT=${LIBYEAR_COUNT}" >> $GITHUB_OUTPUT
- name: Update Libyear badge
uses: RubbaBoy/BYOB@v1.3.0
with:
NAME: libyear
COLOR: blue
LABEL: 'libyear count'
STATUS: ${{ steps.libyear.outputs.LIBYEAR_COUNT }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}