<commit_before>name: Create Draft Release

on:
  push:
    branches:
      - release-*
  workflow_dispatch:
    inputs:
      tagFrom:
        description: The tag to create the release from.
        required: true
        type: string
      tagTo:
        description: The tag to create the release to.
        required: true
        type: string
      branch:
        description: The branch where the release will be created.
        required: true
        type: string

jobs:

  binary:
    name: Create Draft Release
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/setup-node@v3
      - run: npm install semver
      - uses: actions/github-script@v6
        continue-on-error: true
        with:
          script: |
            const semver = require('semver');
            const ref = context.ref.split("/")[2]

            const releases = (await github.rest.repos.listReleases({
              owner: context.payload.repository.owner.login,
              repo: context.payload.repository.name,
              per_page: 100,
            })).data

            let latest_release
            const latest_release_current_branch = releases.find(release => release.tag_name.includes(ref.split("-")[1]))

            if (latest_release_current_branch === undefined){
              latest_release = (await github.rest.repos.getLatestRelease({
                owner: context.payload.repository.owner.login,
                repo: context.payload.repository.name,
              })).data.tag_name
            } else {<commit_msg>Ignore drafts when looking for latest release<commit_after>name: Create Draft Release

on:
  push:
    branches:
      - release-*
  workflow_dispatch:
    inputs:
      tagFrom:
        description: The tag to create the release from.
        required: true
        type: string
      tagTo:
        description: The tag to create the release to.
        required: true
        type: string
      branch:
        description: The branch where the release will be created.
        required: true
        type: string

jobs:

  binary:
    name: Create Draft Release
    runs-on: ubuntu-20.04
    steps:
      - uses: actions/setup-node@v3
      - run: npm install semver
      - uses: actions/github-script@v6
        continue-on-error: true
        with:
          script: |
            const semver = require('semver');
            const ref = context.ref.split("/")[2]

            const releases = (await github.rest.repos.listReleases({
              owner: context.payload.repository.owner.login,
              repo: context.payload.repository.name,
              per_page: 100,
            })).data

            let latest_release
            const latest_release_current_branch = releases.find(release => !release.draft && release.tag_name.includes(ref.split("-")[1]))

            if (latest_release_current_branch === undefined){
              latest_release = (await github.rest.repos.getLatestRelease({
                owner: context.payload.repository.owner.login,
                repo: context.payload.repository.name,
              })).data.tag_name
            } else {
{'fraction_non_alphanumeric': 0.09230769230769231, 'fraction_numerical': 0.007051282051282051, 'mean_word_length': 1.8791512915129152, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 5, 'https://': 0, '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': '4866838', 'n_tokens_mistral': 855, 'n_tokens_neox': 819, 'n_words': 219}