Skip to content

Update personal_archive_prompt.md #892

Update personal_archive_prompt.md

Update personal_archive_prompt.md #892

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: update-readme
# Controls when the workflow will run
on:
push:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
runs-on: ubuntu-latest
steps:
- uses: actions/setup-python@v2
- name: install dependencies
run: |
python -m pip install --upgrade pip
pip install openai loguru tenacity gitpython PyGithub
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
# https://stackoverflow.com/questions/60868897/git-log-dates-incorrect-in-a-github-action
- uses: actions/checkout@v3
with:
fetch-depth: '0'
# this needs to run before the checkout becaue it will result in remotely generated commits
# ... but then we won't have the scripts directory. so checkout first, then pull after i guess
- name: migrate notes in issues
run: |
#git config --local user.name "Github Action"
#git config --local user.email "[email protected]"
python scripts/migrate_issues.py
git pull origin
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
## - name: Predict tags
## if: env.OPENAI_API_KEY != ''
## run: python scripts/tag.py
## env:
## OPENAI_API_KEY: ${{ secrets.OPENAI_API_KEY }}
# - name: move entries to subdir and commit
# run: |
# for file in *.md; do
# if [ "$file" != "README.md" ] && [ "$file" != "FAQ.md" ]; then
# git mv "$file" entries/
# fi
# done
# git config --local user.name "Github Action"
# git config --local user.email "[email protected]"
# git add entries/*.md
# # Thanks for the trick, ChatGPT!
# if git diff-index --quiet HEAD --; then
# echo "changes_to_push=false" >> $GITHUB_ENV
# else
# git commit -m "Updated TOC"
# echo "changes_to_push=true" >> $GITHUB_ENV
# fi
- name: Build README
run: python scripts/update_readme.py
- name: Commit files
#if: "! git status --short" # check if there are changes to commit
run: |
git config --local user.name "Github Action"
git config --local user.email "[email protected]"
git add *.md
git add tags/*.md
# Thanks for the trick, ChatGPT!
if git diff-index --quiet HEAD --; then
echo "changes_to_push=false" >> $GITHUB_ENV
else
git commit -m "Updated TOC"
echo "changes_to_push=true" >> $GITHUB_ENV
fi
- name: Push changes # push the output folder to your repo
if: ${{ env.changes_to_push == 'true' }}
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
force: true