Scan for dead communities #106
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
on: | |
push: | |
branches: | |
- main | |
jobs: | |
UpdatePost: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Read ABOUT.md | |
id: aboutDirectory | |
uses: jaywcjlove/github-action-read-file@main | |
with: | |
branch: main | |
path: README.md | |
- name: Read README.md | |
id: mainReadMe | |
uses: jaywcjlove/github-action-read-file@main | |
with: | |
branch: main | |
path: Directory1.md | |
- name: Read Directory2.md | |
id: lemmyDirectory2 | |
uses: jaywcjlove/github-action-read-file@main | |
with: | |
branch: main | |
path: Directory2.md | |
- name: Read Directory3.md | |
id: lemmyDirectory3 | |
uses: jaywcjlove/github-action-read-file@main | |
with: | |
branch: main | |
path: Directory3.md | |
- name: Read Directory4.md | |
id: lemmyDirectory4 | |
uses: jaywcjlove/github-action-read-file@main | |
with: | |
branch: main | |
path: Directory4.md | |
- name: Read Directory5.md | |
id: lemmyDirectory5 | |
uses: jaywcjlove/github-action-read-file@main | |
with: | |
branch: main | |
path: Directory5.md | |
- name: Echo README.md(gh-pages) | |
run: echo "${{ steps.mainReadMe.outputs.content }}" | |
- name: Login | |
id: Login | |
uses: fjogeleit/http-request-action@v1 | |
with: | |
url: "https://${{ vars.LEMMY_URL }}/api/v3/user/login" | |
data: '{"username_or_email":"${{ vars.LEMMY_USER }}","password":"${{ secrets.LEMMY_PASSWORD }}"}' | |
- name: print3 | |
run: echo "{'name':'${{ vars.POST_TITLE }}','body':'${{ steps.mainReadMe.outputs.content }}','nsfw':false,'post_id':${{ vars.POST_ID }},'language_id':0,'auth':'${{ fromJson(steps.Login.outputs.response).jwt }}'}" | |
# update about post | |
- name: Update about post | |
# You may pin to the exact commit or the version. | |
# uses: fjogeleit/http-request-action@eab8015483ccea148feff7b1c65f320805ddc2bf | |
uses: satak/webrequest-action@master | |
with: | |
# Request URL | |
url: "https://${{ vars.LEMMY_URL }}/api/v3/post" | |
# Request Method | |
method: "PUT" | |
# Content Type | |
headers: '{"Content-Type": "application/json", "Authorization": "Bearer ${{ fromJson(steps.Login.outputs.response).jwt }}"}' | |
# Request Body as JSON String | |
payload: | | |
{"name":"${{ vars.ABOUT_TITLE }}","body":${{ toJson(steps.aboutDirectory.outputs.content) }},"nsfw":false,"post_id":${{ vars.ABOUT_ID }},"language_id":0} | |
# update main post | |
- name: Update post 1 | |
# You may pin to the exact commit or the version. | |
# uses: fjogeleit/http-request-action@eab8015483ccea148feff7b1c65f320805ddc2bf | |
uses: satak/webrequest-action@master | |
with: | |
# Request URL | |
url: "https://${{ vars.LEMMY_URL }}/api/v3/post" | |
# Request Method | |
method: "PUT" | |
# Content Type | |
headers: '{"Content-Type": "application/json", "Authorization": "Bearer ${{ fromJson(steps.Login.outputs.response).jwt }}"}' | |
# Request Body as JSON String | |
payload: | | |
{"name":"${{ vars.POST_TITLE }}","body":${{ toJson(steps.mainReadMe.outputs.content) }},"nsfw":false,"post_id":${{ vars.POST_ID }},"language_id":0} | |
# Update post 2 | |
- name: Update post 2 | |
# You may pin to the exact commit or the version. | |
# uses: fjogeleit/http-request-action@eab8015483ccea148feff7b1c65f320805ddc2bf | |
uses: satak/webrequest-action@master | |
with: | |
# Request URL | |
url: "https://${{ vars.LEMMY_URL }}/api/v3/post" | |
# Request Method | |
method: "PUT" | |
# Content Type | |
headers: '{"Content-Type": "application/json", "Authorization": "Bearer ${{ fromJson(steps.Login.outputs.response).jwt }}"}' | |
# Request Body as JSON String | |
payload: | | |
{"name":"${{ vars.POST2_TITLE }}","body":${{ toJson(steps.lemmyDirectory2.outputs.content) }},"nsfw":false,"post_id":${{ vars.POST2_ID }},"language_id":0} | |
# Update post 3 | |
- name: Update post 3 | |
# You may pin to the exact commit or the version. | |
# uses: fjogeleit/http-request-action@eab8015483ccea148feff7b1c65f320805ddc2bf | |
uses: satak/webrequest-action@master | |
with: | |
# Request URL | |
url: "https://${{ vars.LEMMY_URL }}/api/v3/post" | |
# Request Method | |
method: "PUT" | |
# Content Type | |
headers: '{"Content-Type": "application/json", "Authorization": "Bearer ${{ fromJson(steps.Login.outputs.response).jwt }}"}' | |
# Request Body as JSON String | |
payload: | | |
{"name":"${{ vars.POST3_TITLE }}","body":${{ toJson(steps.lemmyDirectory3.outputs.content) }},"nsfw":false,"post_id":${{ vars.POST3_ID }},"language_id":0} | |
# Update post 4 | |
- name: Update post 4 | |
# You may pin to the exact commit or the version. | |
# uses: fjogeleit/http-request-action@eab8015483ccea148feff7b1c65f320805ddc2bf | |
uses: satak/webrequest-action@master | |
with: | |
# Request URL | |
url: "https://${{ vars.LEMMY_URL }}/api/v3/post" | |
# Request Method | |
method: "PUT" | |
# Content Type | |
headers: '{"Content-Type": "application/json", "Authorization": "Bearer ${{ fromJson(steps.Login.outputs.response).jwt }}"}' | |
# Request Body as JSON String | |
payload: | | |
{"name":"${{ vars.POST4_TITLE }}","body":${{ toJson(steps.lemmyDirectory4.outputs.content) }},"nsfw":false,"post_id":${{ vars.POST4_ID }},"language_id":0} | |
# Update post 5 | |
- name: Update post 5 | |
# You may pin to the exact commit or the version. | |
# uses: fjogeleit/http-request-action@eab8015483ccea148feff7b1c65f320805ddc2bf | |
uses: satak/webrequest-action@master | |
with: | |
# Request URL | |
url: "https://${{ vars.LEMMY_URL }}/api/v3/post" | |
# Request Method | |
method: "PUT" | |
# Content Type | |
headers: '{"Content-Type": "application/json", "Authorization": "Bearer ${{ fromJson(steps.Login.outputs.response).jwt }}"}' | |
# Request Body as JSON String | |
payload: | | |
{"name":"${{ vars.POST5_TITLE }}","body":${{ toJson(steps.lemmyDirectory5.outputs.content) }},"nsfw":false,"post_id":${{ vars.POST5_ID }},"language_id":0} |