arivertisements/.forgejo/workflows/index.yaml
Arija A. 5e60aa3f2d
Add CONTRIBUTORS
Signed-off-by: Arija A. <ari@ari.lt>
2025-08-11 14:04:37 +03:00

45 lines
1.1 KiB
YAML

on:
push:
branches:
- main
paths:
- "meta/**"
- "index.py"
jobs:
index:
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.GIT_TOKEN }}
- name: Set up repository
run: |
git reset --hard
git pull
git reset --hard
- uses: actions/setup-python@v5
with:
python-version: "3.10"
- name: Generate index.json and CONTRIBUTORS
run: |
python3 index.py
- name: Stage the changes
run: |
git add index.json CONTRIBUTORS
- name: Commit and Push Changes
run: |
if git diff --staged --quiet; then
echo "No changes to commit."
else
git config --local user.email "index@localhost"
git config --local user.name "index.py CI/CD"
git commit -am "[skip ci] Update index.json and CONTRIBUTORS" || echo "No changes to commit"
git push origin HEAD -f
fi