Skip to content

Commit 24666e8

Browse files
authored
Merge pull request #58 from fabianegli/fabianegli-restore-attribution
Restore attribution
2 parents 609ddca + eb8e1a4 commit 24666e8

File tree

2 files changed

+44
-10
lines changed

2 files changed

+44
-10
lines changed

.github/workflows/ai_robots_update.yml

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
name: Updates for AI robots files
22
on:
3-
push:
4-
branches:
5-
- "main"
63
schedule:
74
- cron: "0 0 * * *"
85

@@ -24,11 +21,10 @@ jobs:
2421
git --no-pager diff
2522
git add -A
2623
git diff --quiet && git diff --staged --quiet || (git commit -m "Update from Dark Visitors" && git push)
27-
28-
echo "Updating robots.txt and table-of-bot-metrics.md if necessary ..."
29-
python code/dark_visitors.py --convert
30-
echo "... done."
31-
git --no-pager diff
32-
git add -A
33-
git diff --quiet && git diff --staged --quiet || (git commit -m "Updated from new robots.json" && git push)
3424
shell: bash
25+
call-main:
26+
needs: dark-visitors
27+
uses: ./.github/workflows/main.yml
28+
secrets: inherit
29+
with:
30+
message: "Update from Dark Visitors"

.github/workflows/main.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
on:
2+
workflow_call:
3+
inputs:
4+
message:
5+
type: string
6+
required: true
7+
description: The message to commit
8+
push:
9+
paths:
10+
- 'robots.json'
11+
branches:
12+
- "main"
13+
14+
jobs:
15+
ai-robots-txt:
16+
runs-on: ubuntu-latest
17+
name: ai-robots-txt
18+
steps:
19+
- uses: actions/checkout@v4
20+
with:
21+
fetch-depth: 2
22+
- run: |
23+
git config --global user.name "ai.robots.txt"
24+
git config --global user.email "ai.robots.txt@users.noreply.github.com"
25+
git log -1
26+
git status
27+
echo "Updating robots.txt and table-of-bot-metrics.md if necessary ..."
28+
python code/dark_visitors.py --convert
29+
echo "... done."
30+
git --no-pager diff
31+
git add -A
32+
if [ -n "${{ inputs.message }}" ]; then
33+
git commit -m "${{ inputs.message }}"
34+
else
35+
git commit -m "${{ github.event.head_commit.message }}"
36+
fi
37+
git push
38+
shell: bash

0 commit comments

Comments
 (0)