simplify repo and added some tests

This commit is contained in:
fabianegli 2024-10-19 13:06:34 +02:00
parent 6bb598820e
commit 0c05461f84
11 changed files with 527 additions and 181 deletions

View file

@ -1,5 +1,8 @@
name: Daily Update from Dark Visitors
on:
push:
branches:
- "main"
schedule:
- cron: "0 0 * * *"
@ -22,9 +25,3 @@ jobs:
git add -A
git diff --quiet && git diff --staged --quiet || (git commit -m "Daily update from Dark Visitors" && git push)
shell: bash
call-main:
needs: dark-visitors
uses: ./.github/workflows/main.yml
secrets: inherit
with:
message: "Daily update from Dark Visitors"

View file

@ -1,36 +0,0 @@
on:
workflow_call:
inputs:
message:
type: string
required: true
description: The message to commit
push:
paths:
- 'robots.json'
jobs:
ai-robots-txt:
runs-on: ubuntu-latest
name: ai-robots-txt
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 2
- run: |
git config --global user.name "ai.robots.txt"
git config --global user.email "ai.robots.txt@users.noreply.github.com"
git log -1
git status
echo "Running update script ..."
php -f code/action.php
echo "... done."
git --no-pager diff
git add -A
if [ -n "${{ inputs.message }}" ]; then
git commit -m "${{ inputs.message }}"
else
git commit -m "${{ github.event.head_commit.message }}"
fi
git push
shell: bash