<commit_before># Publish @types/vscode for each release

trigger:
  branches:
    include: ['refs/tags/*']

steps:
- task: NodeTool@0
  inputs:
    versionSpec: "10.15.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  inputs:
    versionSpec: "1.10.1"

- bash: |
    # Install build dependencies
    (cd build && yarn)
    node build/azure-pipelines/publish-types/check-version.js
  displayName: Check version

- bash: |
    git config --global user.email "<EMAIL>"
    git config --global user.name "VSCode"

    git clone https://$(GITHUB_TOKEN)@github.com/DefinitelyTyped/DefinitelyTyped.git --depth=1
    node build/azure-pipelines/publish-types/update-types.js

    TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)

    cd DefinitelyTyped

    git diff --color | cat
    git add -A
    git status
    git checkout -b "vscode-types-$TAG_VERSION"
    git commit -m "VS Code $TAG_VERSION Extension API"
    git push origin "vscode-types-$TAG_VERSION"

  displayName: Push update to DefinitelyTyped
<commit_msg>Automate slack message<commit_after># Publish @types/vscode for each release

trigger:
  branches:
    include: ['refs/tags/*']

pr: none

steps:
- task: NodeTool@0
  inputs:
    versionSpec: "10.15.1"

- task: geeklearningio.gl-vsts-tasks-yarn.yarn-installer-task.YarnInstaller@2
  inputs:
    versionSpec: "1.10.1"

- bash: |
    # Install build dependencies
    (cd build && yarn)
    node build/azure-pipelines/publish-types/check-version.js
  displayName: Check version

- bash: |
    git config --global user.email "<EMAIL>"
    git config --global user.name "VSCode"

    git clone https://$(GITHUB_TOKEN)@github.com/DefinitelyTyped/DefinitelyTyped.git --depth=1
    node build/azure-pipelines/publish-types/update-types.js

    TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)

    cd DefinitelyTyped

    git diff --color | cat
    git add -A
    git status
    git checkout -b "vscode-types-$TAG_VERSION"
    git commit -m "VS Code $TAG_VERSION Extension API"
    git push origin "vscode-types-$TAG_VERSION"

  displayName: Push update to DefinitelyTyped

- bash: |
    TAG_VERSION=$(git describe --tags `git rev-list --tags --max-count=1`)
    CHANNEL="G1C14HJ2F"

    MESSAGE="DefinitelyTyped/DefinitelyTyped#vscode-types-$TAG_VERSION created. Endgame master, please open this link, examine changes and create a PR:"
    LINK="https://github.com/DefinitelyTyped/DefinitelyTyped/compare/vscode-types-$TAG_VERSION?quick_pull=1&body=Updating%20VS%20Code%20Extension%20API.%20See%20https%3A%2F%2Fgithub.com%2Fmicrosoft%2Fvscode%2Fissues%2F70175%20for%20details."
    MESSAGE2="[@octref, @jrieken, @kmaetzel, @egamma]. Please review PR to publish @types/vscode."

    curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
    -H 'Content-type: application/json; charset=utf-8' \
    --data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE"'"}' \
    https://slack.com/api/chat.postMessage

    curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
    -H 'Content-type: application/json; charset=utf-8' \
    --data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$LINK"'"}' \
    https://slack.com/api/chat.postMessage

    curl -X POST -H "Authorization: Bearer $(SLACK_TOKEN)" \
    -H 'Content-type: application/json; charset=utf-8' \
    --data '{"channel":"'"$CHANNEL"'", "link_names": true, "text":"'"$MESSAGE2"'"}' \
    https://slack.com/api/chat.postMessage

  displayName: Send message on Slack

{'fraction_non_alphanumeric': 0.14729997172745266, 'fraction_numerical': 0.018377155781735936, 'mean_word_length': 3.5948051948051947, 'pattern_counts': {'":': 9, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 6, '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': '525965', 'n_tokens_mistral': 1262, 'n_tokens_neox': 1219, 'n_words': 272}