GitHub Discussions

Posts a message to GitHub Discussions. You must provide a GitHub token with the write:discussion scope enabled. Will use the same token set in GitHub.

GitHub discussions are currently only possible for repositories that belong to organizations. If you would like to link a release with a discussion then see the use of the discussionCategoryName in the GitHub releaser.

Legend:

  • required

  • optional

  • may use environment variable

  • accepts Name Templates

  • YAML

  • TOML

  • JSON

  • Maven

  • Gradle

# 
announce:
  # 
  discussions:
    # Enables or disables Discussions.
    # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
    # Defaults to `NEVER`.
    # 
    active: ALWAYS

    # Defines the connection timeout in seconds.
    # Defaults to `20`.
    # 
    connectTimeout: 20

    # Defines the read timeout in seconds.
    # Defaults to `60`.
    # 
    readTimeout: 60

    # Additional properties used when evaluating templates.
    #  
    extraProperties:
      # Key will be capitalized and prefixed with `discussions`, i.e, `discussionsFoo`.
      foo: bar

    # The GitHub organization that owns the discussion.
    # 
    organization: some-org

    # The GitHub team that owns the discussion.
    # 
    team: some-team

    # The messages' title.
    # Review the available Name Templates.
    #  
    title: '{{projectNameCapitalized}} {{projectVersion}} released!'

    # The announcement message.
    # Review the available Name Templates.
    #  
    message: ' {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}'

    # Path to a template file that contains the message.
    # Review the available Name Templates.
    # Defaults to `src/jreleaser/templates/discussions.tpl`.
    # 
    messageTemplate: path/to/template/discussions.tpl
# 
[announce.discussions]
  # Enables or disables Discussions.
  # Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
  # Defaults to `NEVER`.
  # 
  active = "ALWAYS"

  # Defines the connection timeout in seconds.
  # Defaults to `20`.
  # 
  connectTimeout = 20

  # Defines the read timeout in seconds.
  # Defaults to `60`.
  # 
  readTimeout = 60

  # Additional properties used when evaluating templates.
  #  
  extraProperties.foo = "bar"
  # Key will be capitalized and prefixed with `discussions`, i.e, `discussionsFoo`.

  # The GitHub organization that owns the discussion.
  # 
  organization = "some-org"

  # The GitHub team that owns the discussion.
  # 
  team = "some-team"

  # The messages' title.
  # Review the available Name Templates.
  #  
  title = "{{projectNameCapitalized}} {{projectVersion}} released!"

  # The announcement message.
  # Review the available Name Templates.
  #  
  message = " {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}"

  # Path to a template file that contains the message.
  # Review the available Name Templates.
  # Defaults to `src/jreleaser/templates/discussions.tpl`.
  # 
  messageTemplate = "path/to/template/discussions.tpl"
{
  // 
  "announce": {
    // 
    "discussions": {
      // Enables or disables Discussions.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      // 
      "active": "ALWAYS",

      // Defines the connection timeout in seconds.
      // Defaults to `20`.
      // 
      "connectTimeout": 20,

      // Defines the read timeout in seconds.
      // Defaults to `60`.
      // 
      "readTimeout": 60,

      // Additional properties used when evaluating templates.
      //  
      "extraProperties": {
        // Key will be capitalized and prefixed with `discussions`, i.e, `discussionsFoo`.
        "foo": "bar"
      },

      // The GitHub organization that owns the discussion.
      // 
      "organization": "some-org",

      // The GitHub team that owns the discussion.
      // 
      "team": "some-team",

      // The messages' title.
      // Review the available Name Templates.
      //  
      "title": "{{projectNameCapitalized}} {{projectVersion}} released!",

      // The announcement message.
      // Review the available Name Templates.
      //  
      "message": " {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}",

      // Path to a template file that contains the message.
      // Review the available Name Templates.
      // Defaults to `src/jreleaser/templates/discussions.tpl`.
      // 
      "messageTemplate": "path/to/template/discussions.tpl"
    }
  }
}
<jreleaser>
  <!--
    
  -->
  <announce>
    <!--
      
    -->
    <discussions>
      <!--
        Enables or disables Discussions.
        Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
        Defaults to `NEVER`.
        
      -->
      <active>ALWAYS</active>

      <!--
        Defines the connection timeout in seconds.
        Defaults to `20`.
        
      -->
      <connectTimeout>20</connectTimeout>

      <!--
        Defines the read timeout in seconds.
        Defaults to `60`.
        
      -->
      <readTimeout>60</readTimeout>

      <!--
        Additional properties used when evaluating templates.
         
      -->
      <extraProperties>
        <!--
          Key will be capitalized and prefixed with `discussions`, i.e, `discussionsFoo`.
        -->
        <foo>bar</foo>
      </extraProperties>

      <!--
        The GitHub organization that owns the discussion.
        
      -->
      <organization>some-org</organization>

      <!--
        The GitHub team that owns the discussion.
        
      -->
      <team>some-team</team>

      <!--
        The messages' title.
        Review the available Name Templates.
         
      -->
      <title>{{projectNameCapitalized}} {{projectVersion}} released!</title>

      <!--
        The announcement message.
        Review the available Name Templates.
         
      -->
      <message> {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}</message>

      <!--
        Path to a template file that contains the message.
        Review the available Name Templates.
        Defaults to `src/jreleaser/templates/discussions.tpl`.
        
      -->
      <messageTemplate>path/to/template/discussions.tpl</messageTemplate>
    </discussions>
  </announce>
</jreleaser>
jreleaser {
  // 
  announce {
    // 
    discussions {
      // Enables or disables Discussions.
      // Valid values are [`NEVER`, `ALWAYS`, `RELEASE`, `SNAPSHOT`].
      // Defaults to `NEVER`.
      // 
      active = 'ALWAYS'

      // Defines the connection timeout in seconds.
      // Defaults to `20`.
      // 
      connectTimeout = 20

      // Defines the read timeout in seconds.
      // Defaults to `60`.
      // 
      readTimeout = 60

      // Additional properties used when evaluating templates.
      // Key will be capitalized and prefixed with `discussions`, i.e, `discussionsFoo`.
      //  
      extraProperties.put('foo', 'bar')

      // The GitHub organization that owns the discussion.
      // 
      organization = 'some-org'

      // The GitHub team that owns the discussion.
      // 
      team = 'some-team'

      // The messages' title.
      // Review the available Name Templates.
      //  
      title = '{{projectNameCapitalized}} {{projectVersion}} released!'

      // The announcement message.
      // Review the available Name Templates.
      //  
      message = ' {{projectNameCapitalized}} {{projectVersion}} has been released! {{releaseNotesUrl}}'

      // Path to a template file that contains the message.
      // Review the available Name Templates.
      // Defaults to `src/jreleaser/templates/discussions.tpl`.
      // 
      messageTemplate = 'path/to/template/discussions.tpl'
    }
  }
}

You may define either message or messageTemplate, with the former taking precedence over the latter.

The template file may be initialized using the template command.