This commit is contained in:
59
.gitea/workflows/generate-readme.yml
Normal file
59
.gitea/workflows/generate-readme.yml
Normal file
@@ -0,0 +1,59 @@
|
||||
name: Generate README
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- '**'
|
||||
paths:
|
||||
- '**/*.sh'
|
||||
- '**/*.bat'
|
||||
- 'scripts/generate_readme.sh'
|
||||
- '.gitea/workflows/generate-readme.yml'
|
||||
|
||||
jobs:
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout
|
||||
uses: actions/checkout@v4
|
||||
with:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- name: Setup SSH with deploy key
|
||||
env:
|
||||
DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
chmod 700 ~/.ssh
|
||||
echo "$DEPLOY_KEY" > ~/.ssh/id_rsa
|
||||
chmod 600 ~/.ssh/id_rsa
|
||||
eval "$(ssh-agent -s)"
|
||||
ssh-add ~/.ssh/id_rsa
|
||||
ssh-keyscan -H git.hudsonriggs.systems >> ~/.ssh/known_hosts
|
||||
git remote set-url origin git@git.hudsonriggs.systems:HRiggs/tools.git
|
||||
|
||||
- name: Generate README
|
||||
run: |
|
||||
bash scripts/generate_readme.sh
|
||||
|
||||
- name: Commit changes
|
||||
run: |
|
||||
if git diff --quiet README.md; then
|
||||
echo "No README changes"
|
||||
exit 0
|
||||
fi
|
||||
git config user.name "gitea-bot"
|
||||
git config user.email "gitea-bot@users.noreply.local"
|
||||
git add README.md
|
||||
git commit -m "docs: auto-generate README for scripts [skip ci]"
|
||||
|
||||
- name: Push changes
|
||||
env:
|
||||
BRANCH_NAME: ${{ github.ref_name }}
|
||||
run: |
|
||||
: "Pushing to branch ${BRANCH_NAME} via SSH"
|
||||
git push origin HEAD:"${BRANCH_NAME}"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user