<commit_before>name: Milestone tracking
on:
  pull_request:
    types: [closed]
jobs:
  add_milestone:
    runs-on: ubuntu-latest
    if: ${{ github.repository == 'dotnet/roslyn-analyzers' && github.event.pull_request.merged_at != null && github.event.pull_request.milestone == null && github.event.pull_request.base.ref == 'main' }}
    steps:
    - name: Get milestone data
      env:
        ORGANIZATION: dotnet
        REPOSITORY: roslyn-analyzers
        MILESTONE_NAME: vNext
      run: |
        gh api graphql -f query='
          query($org: String!, $repo: String!, $milestone: String!) {
            repository(name: $repo, owner: $org) {
              milestones(query: $milestone, first: 2) {
                nodes {
                  id
                  title
                }
              }
            }
          }' -f org=$ORGANIZATION -f repo=$REPOSITORY -f milestone="$MILESTONE_NAME" > milestone_data.json

        cat milestone_data.json
        echo 'MILESTONE_ID='$(jq 'if (((.data.repository.milestones.nodes | length) == 1) and .data.repository.milestones.nodes[0].title == "$MILESTONE_NAME") then .data.repository.milestones.nodes[0].id else null end' label_data.json) >> $GITHUB_ENV

    - name: Assign milestone
      env:
        PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
      run: |
        echo $MILESTONE_ID<commit_msg>Pass GITHUB_TOKEN to automation workflow<commit_after>name: Milestone tracking
on:
  pull_request:
    types: [closed]
jobs:
  add_milestone:
    runs-on: ubuntu-latest
    if: ${{ github.repository == 'dotnet/roslyn-analyzers' && github.event.pull_request.merged_at != null && github.event.pull_request.milestone == null && github.event.pull_request.base.ref == 'main' }}
    steps:
    - name: Get milestone data
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        ORGANIZATION: dotnet
        REPOSITORY: roslyn-analyzers
        MILESTONE_NAME: vNext
      run: |
        gh api graphql -f query='
          query($org: String!, $repo: String!, $milestone: String!) {
            repository(name: $repo, owner: $org) {
              milestones(query: $milestone, first: 2) {
                nodes {
                  id
                  title
                }
              }
            }
          }' -f org=$ORGANIZATION -f repo=$REPOSITORY -f milestone="$MILESTONE_NAME" > milestone_data.json

        cat milestone_data.json
        echo 'MILESTONE_ID='$(jq 'if (((.data.repository.milestones.nodes | length) == 1) and .data.repository.milestones.nodes[0].title == "$MILESTONE_NAME") then .data.repository.milestones.nodes[0].id else null end' label_data.json) >> $GITHUB_ENV

    - name: Assign milestone
      env:
        GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
        PULL_REQUEST_ID: ${{ github.event.pull_request.node_id }}
      run: |
        echo $MILESTONE_ID
{'fraction_non_alphanumeric': 0.12460842325095718, 'fraction_numerical': 0.0027845457709711106, 'mean_word_length': 2.3302433371958284, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '117931', 'n_tokens_mistral': 967, 'n_tokens_neox': 899, 'n_words': 185}