<commit_before>name: 'Publish to NPM'

on:
  workflow_run:
    workflows: ['Node.js CI']
    types: [completed]
    branches: [main]

jobs:
  publish-new-version:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - name: git setup
        run: |
          git config --local user.email "41898282+github-actions[<EMAIL>"
          git config --local user.name "github-actions[bot]"
      - name: setup node
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          registry-url: 'https://registry.npmjs.org'
      - name: npm install
        run: npm ci
      - name: Should release
        run: npm run should-release -- -v
      - name: npm release
        run: npm run release
      - run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
      - name: push changes to github
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref }}
          tags: true<commit_msg>chore: should release with graceful job exit<commit_after>name: 'Publish to NPM'

on:
  workflow_run:
    workflows: ['Node.js CI']
    types: [completed]
    branches: [main]

jobs:
  publish-new-version:
    runs-on: ubuntu-latest
    if: ${{ github.event.workflow_run.conclusion == 'success' }}
    steps:
      - uses: actions/checkout@v2
        with:
          fetch-depth: '0'
      - name: git setup
        run: |
          git config --local user.email "41898282+github-actions[bot]<EMAIL>"
          git config --local user.name "github-actions[bot]"
      - name: setup node
        uses: actions/setup-node@v3
        with:
          node-version: 16.x
          registry-url: 'https://registry.npmjs.org'
      - name: npm install
        run: npm ci

      - name: Should release
        id: should_release
        continue-on-error: true
        run: npm run should-release -- -v

      - name: No release
        if: steps.should_release.outcome != 'success'
        run: echo "No release required. Skipping publishing."

      - name: Version bump
        if: steps.should_release.outcome == 'success'
        run: npm run release

      - name: Publish to NPM
        if: steps.should_release.outcome == 'success'
        run: npm publish
        env:
          NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

      - name: Push commits to GitHub
        if: steps.should_release.outcome == 'success'
        uses: ad-m/github-push-action@master
        with:
          github_token: ${{ secrets.GITHUB_TOKEN }}
          branch: ${{ github.ref }}
          tags: true
{'fraction_non_alphanumeric': 0.116398243045388, 'fraction_numerical': 0.00951683748169839, 'mean_word_length': 1.919871794871795, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '639411', 'n_tokens_mistral': 889, 'n_tokens_neox': 833, 'n_words': 217}