Skip to content

Commit

Permalink
Merge pull request #58 from fabianegli/fabianegli-restore-attribution
Browse files Browse the repository at this point in the history
Restore attribution
  • Loading branch information
glyn authored Nov 29, 2024
2 parents 609ddca + eb8e1a4 commit 24666e8
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 10 deletions.
16 changes: 6 additions & 10 deletions .github/workflows/ai_robots_update.yml
Original file line number Diff line number Diff line change
@@ -1,8 +1,5 @@
name: Updates for AI robots files
on:
push:
branches:
- "main"
schedule:
- cron: "0 0 * * *"

Expand All @@ -24,11 +21,10 @@ jobs:
git --no-pager diff
git add -A
git diff --quiet && git diff --staged --quiet || (git commit -m "Update from Dark Visitors" && git push)
echo "Updating robots.txt and table-of-bot-metrics.md if necessary ..."
python code/dark_visitors.py --convert
echo "... done."
git --no-pager diff
git add -A
git diff --quiet && git diff --staged --quiet || (git commit -m "Updated from new robots.json" && git push)
shell: bash
call-main:
needs: dark-visitors
uses: ./.github/workflows/main.yml
secrets: inherit
with:
message: "Update from Dark Visitors"
38 changes: 38 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
on:
workflow_call:
inputs:
message:
type: string
required: true
description: The message to commit
push:
paths:
- 'robots.json'
branches:
- "main"

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 "[email protected]"
git log -1
git status
echo "Updating robots.txt and table-of-bot-metrics.md if necessary ..."
python code/dark_visitors.py --convert
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

0 comments on commit 24666e8

Please sign in to comment.