Skip to content

Lexicon Updater

Lexicon Updater #25

name: Lexicon Updater
on:
schedule:
- cron: "0 1 * * *"
workflow_dispatch:
jobs:
update-lexicons:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Make pull_atproto.sh executable
run: |
chmod +x ./.scripts/pull_atproto.sh
- name: Pull lexicons from atproto repo
run: ./.scripts/pull_atproto.sh
- name: Git Differences
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config --local user.name "Lexicon Updater"
git config --local user.email "hiddenlearner@duck.com"
git add .
if git diff-index --quiet HEAD; then
echo "has_changes=false" >> $GITHUB_OUTPUT
else
echo "has_changes=true" >> $GITHUB_OUTPUT
fi
- name: Commit changes
if: steps.git_diff.outputs.has_changes == 'true'
id: commit
run: |
git checkout -b update-lexicons-$(date +%Y%m%d%H%M%S)
git commit -m "Update lexicons"
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Push changes
if: steps.commit.outputs.has_changes == 'true'
run: |
git push origin update-lexicons-$(date +%Y%m%d%H%M%S)
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Create Pull Request
if: steps.commit.outputs.has_changes == 'true'
uses: peter-evans/create-pull-request@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: update-lexicons-$(date +%Y%m%d%H%M%S)
title: "Update lexicons"
body: "This is an automated PR. New Lexicons from Bluesky/atproto were detected."
labels: "automation"