Files
lolcathost/.github/workflows/autoupdate.yaml
T

56 lines
1.2 KiB
YAML

name: AutoUpdate
on:
schedule:
- cron: "0 3 * * *"
workflow_dispatch:
permissions:
contents: write
actions: write
jobs:
autoupdate:
name: Update dependencies and test
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version: "1.24"
cache: true
- name: Update dependencies
run: |
go get -u ./...
go mod tidy
- name: Run tests
run: go test -race -cover ./...
- name: Commit changes
id: auto-commit
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: "Update go.mod and go.sum"
file_pattern: "go.mod go.sum"
- name: Trigger release workflow
if: steps.auto-commit.outputs.changes_detected == 'true'
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
await github.rest.actions.createWorkflowDispatch({
owner: 'lukaszraczylo',
repo: 'lolcathost',
workflow_id: 'release.yml',
ref: 'main'
})