Skip to content

Pull README from https://flyingacorn.studio/index.html #5

Pull README from https://flyingacorn.studio/index.html

Pull README from https://flyingacorn.studio/index.html #5

name: GitHub Actions
run-name: Pull README from https://flyingacorn.studio/index.html
on:
repository_dispatch:
types:
- update-readme
jobs:
job1:
name: Create-Markdown-File
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Download index.html
run: curl -o index.html https://flyingacorn.studio/index.html
- name: Setup Python
uses: actions/setup-python@v5.1.1
with:
python-version: '3.10'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install html2text
- name: Create empty markdown file
run: |
echo "This file generates automatically from https://flyingacorn.studio/index.html as part of a GitHub Action practice." > 'profile/README.md'
- name: Generate Markdown
run: html2text --ignore-images --single-line-break --wrap-list-items -d index.html >> 'profile/README.md'
- name: verify changes
id: verify_changes
run: |
git diff --quiet README.md || echo "changed=true" >> $GITHUB_OUTPUT
- name: Commit changes
if: steps.verify_changes.outputs.changed == 'true'
run: |
git config --local user.email "amir@flyingacorn.studio"
git config --local user.name "GitHub Actions"
git add profile/README.md
git commit -m "Update README.md"
- name: Push changes
if: steps.verify_changes.outputs.changed == 'true'
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
branch: ${{ github.ref }}