mirror of
https://github.com/ai-robots-txt/ai.robots.txt.git
synced 2025-04-19 16:35:03 +00:00
simplify repo and added some tests
This commit is contained in:
parent
6bb598820e
commit
0c05461f84
11 changed files with 527 additions and 181 deletions
9
.github/workflows/daily_update.yml
vendored
9
.github/workflows/daily_update.yml
vendored
|
@ -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"
|
||||
|
|
36
.github/workflows/main.yml
vendored
36
.github/workflows/main.yml
vendored
|
@ -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
|
Loading…
Add table
Add a link
Reference in a new issue