Skip to content

Ways to automatically update own robot.txt with latest update from here #59

Closed Answered by Andre601
Andre601 asked this question in Q&A
Discussion options

You must be logged in to vote

Managed to setup the following Actions file:

name: "Update robots.txt"

on:
  schedule:
    - cron: "0 12 * * 0" # Once a week
  workflow_dispatch:

jobs:
  updateRobotsFile:
    runs-on: codeberg-tiny-lazy
    container:
      image: ghcr.io/catthehacker/ubuntu:act-latest
    steps:
      - name: "Checkout website repository"
        uses: https://code.forgejo.org/actions/checkout@v4
        with:
          token: ${{ secrets.BOT_TOKEN }}
          path: source
      - name: "Checkout ai.robots.txt Repository"
        run: "git clone https://github.com/ai-robots-txt/ai.robots.txt remote"
      - name: "Update file if different"
        run: |
          if git diff --no-index --exit-code …

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Andre601
Comment options

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by Andre601
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants