60 lines
1.7 KiB
YAML
60 lines
1.7 KiB
YAML
name: Update handler-base
|
|
|
|
on:
|
|
repository_dispatch:
|
|
types: [handler-base-release]
|
|
|
|
env:
|
|
NTFY_URL: http://ntfy.observability.svc.cluster.local:80
|
|
|
|
jobs:
|
|
update:
|
|
name: Update handler-base dependency
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
with:
|
|
token: ${{ secrets.GITEA_TOKEN }}
|
|
|
|
- name: Set up Go
|
|
uses: actions/setup-go@v5
|
|
with:
|
|
go-version-file: go.mod
|
|
cache: true
|
|
|
|
- name: Configure Git
|
|
run: |
|
|
git config user.name "gitea-actions[bot]"
|
|
git config user.email "actions@git.daviestechlabs.io"
|
|
|
|
- name: Update handler-base
|
|
run: |
|
|
VERSION="${{ gitea.event.client_payload.version }}"
|
|
echo "Updating handler-base to ${VERSION}"
|
|
GONOSUMCHECK=git.daviestechlabs.io GONOSUMDB=git.daviestechlabs.io \
|
|
go get git.daviestechlabs.io/daviestechlabs/handler-base@${VERSION}
|
|
go mod tidy
|
|
|
|
- name: Commit and push
|
|
run: |
|
|
VERSION="${{ gitea.event.client_payload.version }}"
|
|
if git diff --quiet go.mod go.sum; then
|
|
echo "No changes to commit"
|
|
exit 0
|
|
fi
|
|
git add go.mod go.sum
|
|
git commit -m "chore(deps): bump handler-base to ${VERSION}"
|
|
git push
|
|
|
|
- name: Notify
|
|
if: success()
|
|
run: |
|
|
VERSION="${{ gitea.event.client_payload.version }}"
|
|
curl -s \
|
|
-H "Title: 📦 Dep Update: ${{ gitea.repository }}" \
|
|
-H "Priority: default" \
|
|
-H "Tags: package,github" \
|
|
-d "handler-base updated to ${VERSION}" \
|
|
${{ env.NTFY_URL }}/gitea-ci
|