<commit_before>name: Announce release on Discuss

env:
  CA_FILE: /tmp/ca.pem
  URL: https://discuss.axoniq.io/posts.json

  # id of `Announcements` category in Discuss
  CATEGORY: 6

on:
  # Triggers the workflow on new release
  workflow_call:
    inputs:
      release_name:
        required: true
        type: string
      release_notes_file:
        required: true
        type: string
      release_date:
        type: number
        required: true

jobs:
  announce:
    runs-on: ubuntu-latest
    steps:

      - name: Get authorities certificates
        run: openssl s_client -showcerts -connect discuss.axoniq.io:443 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p' > $CA_FILE

      - name: Read release notes file
        id: read_release_notes
        uses: juliangruber/read-file-action@v1
        with:
          path: ${{ release_notes_file }}

      - name: Create Discuss topic
        run: |
          
          echo $json | curl --cacert $CA_FILE -X POST "$URL" \
          -H "Api-Key: ${{ secrets.DISCUSS_KEY }}" \
          -H "Api-Username: axonbot" \
          -H 'Content-Type: application/json' \
          --data-binary @- << EOF
          {
            "title": "${{ release_name }}",
            "raw": "I’m glad to announce that we’ve released ${{ release_name }} on ${{ release_date }}.<br\>
          This release contains: <br/> ${{ release_notes}}",
            "category": $CATEGORY,
            "tags": ["release"]
          }
          EOF
        with:
          release_name: ${{ release_name }}
          release_date: ${{ release_date }}
          release_notes: ${{ steps.read_release_notes.outputs.content }}<commit_msg>Add missing "inputs" prefix<commit_after>name: Announce release on Discuss

env:
  CA_FILE: /tmp/ca.pem
  URL: https://discuss.axoniq.io/posts.json

  # id of `Announcements` category in Discuss
  CATEGORY: 6

on:
  # Triggers the workflow on new release
  workflow_call:
    inputs:
      release_name:
        required: true
        type: string
      release_notes_file:
        required: true
        type: string
      release_date:
        type: number
        required: true

jobs:
  announce:
    runs-on: ubuntu-latest
    steps:

      - name: Get authorities certificates
        run: openssl s_client -showcerts -connect discuss.axoniq.io:443 </dev/null | sed -n -e '/-.BEGIN/,/-.END/ p' > $CA_FILE

      - name: Read release notes file
        id: read_release_notes
        uses: juliangruber/read-file-action@v1
        with:
          path: ${{ inputs.release_notes_file }}

      - name: Create Discuss topic
        run: |
          
          echo $json | curl --cacert $CA_FILE -X POST "$URL" \
          -H "Api-Key: ${{ secrets.DISCUSS_KEY }}" \
          -H "Api-Username: axonbot" \
          -H 'Content-Type: application/json' \
          --data-binary @- << EOF
          {
            "title": "${{ release_name }}",
            "raw": "I’m glad to announce that we’ve released ${{ release_name }} on ${{ release_date }}.<br\>
          This release contains: <br/> ${{ release_notes}}",
            "category": $CATEGORY,
            "tags": ["release"]
          }
          EOF
        with:
          release_name: ${{ inputs.release_name }}
          release_date: ${{ inputs.release_date }}
          release_notes: ${{ steps.read_release_notes.outputs.content }}
{'fraction_non_alphanumeric': 0.12407021719726272, 'fraction_numerical': 0.002975304968759298, 'mean_word_length': 1.905790838375108, 'pattern_counts': {'":': 8, '<': 13, '<?xml version=': 0, '>': 9, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '240170', 'n_tokens_mistral': 1070, 'n_tokens_neox': 1023, 'n_words': 265}