Skip to content

Adding a new page

Chris Young edited this page Jun 25, 2024 · 2 revisions

Notes on how to add a new directory post

      - 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
Clone this wiki locally