-
Notifications
You must be signed in to change notification settings - Fork 0
Adding a new page
Chris Young edited this page Jun 25, 2024
·
2 revisions
Notes on how to add a new directory post
- Log in to https://lemmy.dbzer0.com/login as directorybot (ask @chris-y for password)
- Create a new post in lemmydirectory
- Copy the post ID from the URL
- Go here: https://github.com/fnic-lemmy/lemmy-directory/settings/variables/actions
- Add a var PAGEx_ID with the post ID in the contents
- Add a var PAGEx_TITLE with the post title in the contents
- In the workflow https://github.com/fnic-lemmy/lemmy-directory/blob/main/.github/workflows/main.yml
- Add a section like the below with the others:
- name: Read Directory5.md
id: lemmyDirectory5
uses: jaywcjlove/github-action-read-file@main
with:
branch: main
path: Directory5.md
- Add a section like the below at the bottom of the file, replacing POST5_ID, POST5_TITLE and lemmyDirectory5
# 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}
- Create the new page in GitHub