Skip to content

mamuso/discussion-to-markdown-action

Repository files navigation

GitHub Discussion to Markdown

Build and Test

An action for transforming a GitHub Discussion into a markdown output.

Usage

Create a workflow (e.g. .github/workflows/discussion-to-markdown.yml) with the following content:

name: Discussion to Markdown
run-name: Capture ${{ inputs.discussion-url }}

on:
  workflow_dispatch:
    inputs:
      discussion-url:
        type: string
        description: GitHub discussion URL
        required: true

jobs:
  test-discussion-to-markdown:
    name: Discussion to Markdown
    runs-on: ubuntu-latest
    steps:
      - uses: mamuso/discussion-to-markdown-action@main
        with:
          discussion-url: ${{ github.event.inputs.discussion-url }}
          token: ${{ secrets.TOKEN }}

If you are planning to capture a discussion from the same repository, you can use the default GITHUB_TOKEN secret (token: ${{ secrets.GITHUB_TOKEN }}). Otherwise, you will need to create a personal access token and add it to the repository secrets as TOKEN.

If you are planning to capture discussions from a private repository, you may want to execute this action in a private repo too.

What to expect

Once you have the workflow in your repository, you can trigger it by going to the Actions tab and:

  1. Click on the Discussion to Markdown workflow on the navigation
  2. Click on the Run workflow button
  3. Fill the discussion-url input with the URL of the discussion you want to capture

Discussion to Markdown instructions

  1. After submitting the form, you will see the workflow running.
  2. Once it's done, the markdown content will be available as part of the run summary.

Discussion to Markdown instructions

If you need to use the markdown content in a different step, you can use the markdown output of the action.

Known limitations

This action uses the GitHub graphql API to fetch the discussion content. The API has a limit of 100 comments per page. If your discussion has more than 100 comments, the action will not be able to capture all the content.

About

An action for transforming a GitHub Discussion into a markdown output.

Resources

License

Stars

Watchers

Forks

Packages

No packages published