From 77ddf284463a2ace5e0cad23a3e2ef8bc0c35995 Mon Sep 17 00:00:00 2001 From: Amir Hakimnejad Date: Fri, 26 Jul 2024 14:51:34 +0330 Subject: [PATCH] Add actions --- README.md | 1 - workflows/github-actions.yaml | 42 +++++++++++++++++++++++++++++++++++ 2 files changed, 42 insertions(+), 1 deletion(-) delete mode 100644 README.md create mode 100644 workflows/github-actions.yaml diff --git a/README.md b/README.md deleted file mode 100644 index ac02ee1..0000000 --- a/README.md +++ /dev/null @@ -1 +0,0 @@ -TEST desc diff --git a/workflows/github-actions.yaml b/workflows/github-actions.yaml new file mode 100644 index 0000000..2c9adfa --- /dev/null +++ b/workflows/github-actions.yaml @@ -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 }} \ No newline at end of file