dep-update #24
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: dep-update | |
on: | |
# 手動觸發,可做用於任一 branch | |
workflow_dispatch: | |
# 排程觸發,只做用於 default branch | |
schedule: | |
- cron: "0 0 * * 1" # In UTC time, 格式請參考: https://crontab.guru/ | |
jobs: | |
dep-update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Setup Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: '1.22.x' | |
- name: Update dependencies | |
run: go get -t -u ./... | |
- name: Tidy | |
run: go mod tidy | |
- name: Create Pull Request | |
id: cpr | |
uses: peter-evans/create-pull-request@v6 | |
# 請參考 https://github.com/peter-evans/create-pull-request 以獲得更詳盡的說明 | |
with: | |
commit-message: "chore: update dependencies" | |
title: "chore: update dependencies" | |
committer: bot <[email protected]> | |
author: bot <[email protected]> | |
body: >- | |
chore: update dependencies | |
labels: "dependencies-update" | |
branch: "dep-update/${{ github.ref_name }}" | |
delete-branch: true | |
- name: Enable Auto-merge | |
if: steps.cpr.outputs.pull-request-operation == 'created' | |
run: gh pr merge --squash --auto "${{ steps.cpr.outputs.pull-request-number }}" | |
env: | |
GH_TOKEN: ${{ github.token }} | |
keepalive: | |
runs-on: ubuntu-latest | |
permissions: | |
actions: write | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: gautamkrishnar/keepalive-workflow@v2 |