Skip to content

Commit

Permalink
add auto updater
Browse files Browse the repository at this point in the history
  • Loading branch information
Asutorufa committed Feb 13, 2025
1 parent 81e58d2 commit cf6777f
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 3 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: updater

on:
# run action when a change lands in the main branch which updates go.mod or
# our license template file. Also allow manual triggering.
push:
branches:
- main

concurrency:
group: ${{ github.workflow }}-$${{ github.head_ref || github.run_id }}
cancel-in-progress: true

jobs:
licenses-update:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: go.mod

- name: Get access token
uses: actions/create-github-app-token@v1
id: generate-token
with:
app-id: ${{ vars.APP_ID }}
private-key: ${{ secrets.PRIVATE_KEY }}
owner: ${{ github.repository_owner }}

- name: Run update
run: |
bash push.sh
- name: Send pull request
uses: peter-evans/create-pull-request@v7
with:
token: ${{ steps.generate-token.outputs.token }}
author: Kitte Updater <[email protected]>
committer: Kitte Updater <[email protected]>
branch: auto-update
commit-message: "auto update"
title: "auto update"
body: Triggered by ${{ github.repository }}@${{ github.sha }}
delete-branch: true
signoff: true
6 changes: 3 additions & 3 deletions push.sh
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,6 @@ cd yuhaiin
. ./update.sh
cd ..

git add .
git commit -m "update"
git push -u origin main
# git add .
# git commit -m "update"
# git push -u origin main

0 comments on commit cf6777f

Please sign in to comment.