Skip to content

Commit

Permalink
Add actions
Browse files Browse the repository at this point in the history
  • Loading branch information
amirhakimnejad committed Jul 26, 2024
1 parent 9697621 commit 77ddf28
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 1 deletion.
1 change: 0 additions & 1 deletion README.md

This file was deleted.

42 changes: 42 additions & 0 deletions workflows/github-actions.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
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: 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 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 }}

0 comments on commit 77ddf28

Please sign in to comment.