<commit_before>{
  "Id": "ActionTemplates-5",
  "Name": "HipChat - Notify (v1)",
  "Description": "Send a success notification when this step is executed.",
  "ActionType": "Octopus.Script",
  "Version": 4,
  "Properties": {
    "Octopus.Action.Script.ScriptBody": "$message = if ($OctopusParameters['HipChatMessage']) { $OctopusParameters['HipChatMessage'] } else { \"(successful) \" + $OctopusParameters['Octopus.Project.Name'] + \" [v$($OctopusParameters['Octopus.Release.Number'])] deployed to $($OctopusParameters['Octopus.Environment.Name'])  on $($OctopusParameters['Octopus.Machine.Name'])\" } \r\n#---------\r\n$apitoken = $OctopusParameters['HipChatAuthToken']\r\n$roomid = $OctopusParameters['HipChatRoomId']\r\n$from = $OctopusParameters['HipChatFrom']\r\n$colour = $OctopusParameters['HipChatColor']\r\n\r\nTry \r\n{\r\n\t#Do the HTTP POST to HipChat\r\n\t$post = \"auth_token=$apitoken&room_id=$roomid&from=$from&color=$colour&message=$message&notify=1&message_format=text\"\r\n\t$webRequest = [System.Net.WebRequest]::Create(\"https://api.hipchat.com/v1/rooms/message\")\r\n\t$webRequest.ContentType = \"application/x-www-form-urlencoded\"\r\n\t$postStr = [System.Text.Encoding]::UTF8.GetBytes($post)\r\n\t$webrequest.ContentLength = $postStr.Length\r\n\t$webRequest.Method = \"POST\"\r\n\t$requestStream = $webRequest.GetRequestStream()\r\n\t$requestStream.Write($postStr, 0,$postStr.length)\r\n\t$requestStream.Close()\r\n\t\r\n\t[System.Net.WebResponse] $resp = $webRequest.GetResponse();\r\n\t$rs = $resp.GetResponseStream();\r\n\t[System.IO.StreamReader] $sr = New-Object System.IO.StreamReader -argumentList $rs;\r\n\t$sr.ReadToEnd();\t\t\t\t\t\r\n}\r\ncatch [Exception] {\r\n\t\"Woah!, wasn't expecting to get this exception. `r`n $_.Exception.ToString()\"\r\n}"
  },
  "SensitiveProperties": {},
  "Parameters": [
    {
      "Name": "HipChatRoomId",
      "Label": "Room Id",
      "HelpText": null,
      "DefaultValue": null
    },
    {
      "Name": "HipChatAuthToken",
      "Label": "Auth token",
      "HelpText": "For API version 1.",
      "DefaultValue": null
    },
    {
      "Name": "HipChatFrom",
      "Label": "From name",
      "HelpText": null,
      "DefaultValue": "Octopus Deploy"
    },
    {
      "Name": "HipChatColor",<commit_msg>Added API to the suffix, because memory and old age<commit_after>{
  "Id": "ActionTemplates-5",
  "Name": "HipChat - Notify (API v1)",
  "Description": "Send a success notification when this step is executed.",
  "ActionType": "Octopus.Script",
  "Version": 4,
  "Properties": {
    "Octopus.Action.Script.ScriptBody": "$message = if ($OctopusParameters['HipChatMessage']) { $OctopusParameters['HipChatMessage'] } else { \"(successful) \" + $OctopusParameters['Octopus.Project.Name'] + \" [v$($OctopusParameters['Octopus.Release.Number'])] deployed to $($OctopusParameters['Octopus.Environment.Name'])  on $($OctopusParameters['Octopus.Machine.Name'])\" } \r\n#---------\r\n$apitoken = $OctopusParameters['HipChatAuthToken']\r\n$roomid = $OctopusParameters['HipChatRoomId']\r\n$from = $OctopusParameters['HipChatFrom']\r\n$colour = $OctopusParameters['HipChatColor']\r\n\r\nTry \r\n{\r\n\t#Do the HTTP POST to HipChat\r\n\t$post = \"auth_token=$apitoken&room_id=$roomid&from=$from&color=$colour&message=$message&notify=1&message_format=text\"\r\n\t$webRequest = [System.Net.WebRequest]::Create(\"https://api.hipchat.com/v1/rooms/message\")\r\n\t$webRequest.ContentType = \"application/x-www-form-urlencoded\"\r\n\t$postStr = [System.Text.Encoding]::UTF8.GetBytes($post)\r\n\t$webrequest.ContentLength = $postStr.Length\r\n\t$webRequest.Method = \"POST\"\r\n\t$requestStream = $webRequest.GetRequestStream()\r\n\t$requestStream.Write($postStr, 0,$postStr.length)\r\n\t$requestStream.Close()\r\n\t\r\n\t[System.Net.WebResponse] $resp = $webRequest.GetResponse();\r\n\t$rs = $resp.GetResponseStream();\r\n\t[System.IO.StreamReader] $sr = New-Object System.IO.StreamReader -argumentList $rs;\r\n\t$sr.ReadToEnd();\t\t\t\t\t\r\n}\r\ncatch [Exception] {\r\n\t\"Woah!, wasn't expecting to get this exception. `r`n $_.Exception.ToString()\"\r\n}"
  },
  "SensitiveProperties": {},
  "Parameters": [
    {
      "Name": "HipChatRoomId",
      "Label": "Room Id",
      "HelpText": null,
      "DefaultValue": null
    },
    {
      "Name": "HipChatAuthToken",
      "Label": "Auth token",
      "HelpText": "For API version 1.",
      "DefaultValue": null
    },
    {
      "Name": "HipChatFrom",
      "Label": "From name",
      "HelpText": null,
      "DefaultValue": "Octopus Deploy"
    },
    {
      "Name": "HipChatColor",
{'fraction_non_alphanumeric': 0.2082971329278888, 'fraction_numerical': 0.0034752389226759338, 'mean_word_length': 4.373395565927654, 'pattern_counts': {'":': 44, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 2, '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': '6630692', 'n_tokens_mistral': 1714, 'n_tokens_neox': 1661, 'n_words': 225}