quickly-conf-sshd/.github/workflows/main.yml
2023-10-24 14:56:43 +08:00

45 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: 更新个人访问地址
on:
# schedule:
# - cron: "0 0 * * *"
workflow_dispatch:
permissions:
contents: write
jobs:
# 使用 actions/github-script 向 README 文件写入个人访问地址。
check-updates:
timeout-minutes: 30
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- uses: actions/labeler@v4
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
- name: Commit
run: |
sed -i "s/ssh.lamgc.me/$REPLACEMENT_VALUE/g" README.md
git config --global user.name "$GIT_USERNAME"
git config --global user.email "$GIT_EMAIL"
git add README.md
git commit -m "更新个人访问地址"
git push -u origin main
env:
# 要替换的个人访问地址例如ssh.lamgc.me
REPLACEMENT_VALUE: ${{ secrets.REPLACEMENT_VALUE }}
# Github用户名
GIT_USERNAME: ${{ secrets.GIT_USERNAME }}
# Github邮箱
GIT_EMAIL: ${{ secrets.GIT_EMAIL }}
- name: 提交更改
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: 更新个人访问地址
commit_options: '--no-verify'
push_options: '--force'
file_pattern: LATEST_VERSION