Version 2.0 does not catch authentication errors from Totango.
The call to Totango succeeds; however, the HTTP code returned is 401. We should be aware of this and give the user a human readable message with guidance on how to fix it.
[error]Failed to create touchpoint: 401
2023-04-11T15:15:10.3460895Z Requested labels: ubuntu-latest
2023-04-11T15:15:10.3461014Z Job defined at: jmassardo/action_test/.github/workflows/totango.yml@refs/heads/main
2023-04-11T15:15:10.3461097Z Waiting for a runner to pick up this job...
2023-04-11T15:15:11.5969958Z Job is waiting for a hosted runner to come online.
2023-04-11T15:15:14.2445282Z Job is about to start running on the hosted runner: GitHub Actions 2 (hosted)
2023-04-11T15:15:16.5769228Z Current runner version: '2.303.0'
2023-04-11T15:15:16.5798113Z ##[group]Operating System
2023-04-11T15:15:16.5798686Z Ubuntu
2023-04-11T15:15:16.5799088Z 22.04.2
2023-04-11T15:15:16.5799404Z LTS
2023-04-11T15:15:16.5799721Z ##[endgroup]
2023-04-11T15:15:16.5800066Z ##[group]Runner Image
2023-04-11T15:15:16.5800471Z Image: ubuntu-22.04
2023-04-11T15:15:16.5800840Z Version: 20230409.1
2023-04-11T15:15:16.5801401Z Included Software: https://github.com/actions/runner-images/blob/ubuntu22/20230409.1/images/linux/Ubuntu2204-Readme.md
2023-04-11T15:15:16.5802082Z Image Release: https://github.com/actions/runner-images/releases/tag/ubuntu22%2F20230409.1
2023-04-11T15:15:16.5802584Z ##[endgroup]
2023-04-11T15:15:16.5802968Z ##[group]Runner Image Provisioner
2023-04-11T15:15:16.5803334Z 2.0.139.1
2023-04-11T15:15:16.5803676Z ##[endgroup]
2023-04-11T15:15:16.5804719Z ##[group]GITHUB_TOKEN Permissions
2023-04-11T15:15:16.5805419Z Actions: write
2023-04-11T15:15:16.5805758Z Checks: write
2023-04-11T15:15:16.5806333Z Contents: write
2023-04-11T15:15:16.5806741Z Deployments: write
2023-04-11T15:15:16.5807105Z Discussions: write
2023-04-11T15:15:16.5807495Z Issues: write
2023-04-11T15:15:16.5807826Z Metadata: read
2023-04-11T15:15:16.5808167Z Packages: write
2023-04-11T15:15:16.5808499Z Pages: write
2023-04-11T15:15:16.5808884Z PullRequests: write
2023-04-11T15:15:16.5809275Z RepositoryProjects: write
2023-04-11T15:15:16.5809672Z SecurityEvents: write
2023-04-11T15:15:16.5810052Z Statuses: write
2023-04-11T15:15:16.5810413Z ##[endgroup]
2023-04-11T15:15:16.5812945Z Secret source: Actions
2023-04-11T15:15:16.5813432Z Prepare workflow directory
2023-04-11T15:15:16.6567242Z Prepare all required actions
2023-04-11T15:15:16.6753867Z Getting action download info
2023-04-11T15:15:17.3065491Z Download action repository 'jmassardo/issues-to-totango@version2.0' (SHA:1e4eb6a71e725599ddc39e6f458f520d5bbc8530)
2023-04-11T15:15:18.1109031Z Complete job name: process-issue
2023-04-11T15:15:18.2171919Z ##[group]Run jmassardo/issues-to-totango@version2.0
2023-04-11T15:15:18.2172370Z with:
2023-04-11T15:15:18.2172940Z ACCOUNT_ID: ***
2023-04-11T15:15:18.2173435Z APP_TOKEN: ***
2023-04-11T15:15:18.2173762Z ACTIVITY_TYPE: nurture_1618339431022
2023-04-11T15:15:18.2174162Z TOUCHPOINT_TYPE: ***
2023-04-11T15:15:18.2174553Z TOUCHPOINT_TAGS: ***
2023-04-11T15:15:18.2174917Z TASK_ASSIGNEE: jmassardo@github.com
2023-04-11T15:15:18.2175244Z ##[endgroup]
2023-04-11T15:15:18.5283496Z Issue num is: 108
2023-04-11T15:15:18.5284738Z eventName is: issues
2023-04-11T15:15:18.5286085Z Event Action is: labeled
2023-04-11T15:15:18.5286410Z Formatting body...
2023-04-11T15:15:18.5377881Z Promise { <pending> }
2023-04-11T15:15:18.5382464Z Touchpoint subject is: [New Topic]: testing 2.0 again
2023-04-11T15:15:18.5383405Z Touchpoint body is: <div class="html-parser-container"><h3 id="description">Description:</h3>
2023-04-11T15:15:18.5383861Z <div>testing 2.0 again</div><br />
2023-04-11T15:15:18.5384372Z <h3 id="keystakeholders">Key Stakeholders:</h3>
2023-04-11T15:15:18.5384802Z <div>Lots o people</div><br />
2023-04-11T15:15:18.5385143Z <h3 id="timetable">Timetable:</h3>
2023-04-11T15:15:18.5385520Z <h2 id="hopefullytoday">hopefully today</h2>
2023-04-11T15:15:18.5385892Z <div>jmassardo labeled an issue #108<br />
2023-04-11T15:15:18.5386485Z More info here: <a href="https://github.com/jmassardo/action_test/issues/108">https://github.com/jmassardo/action_test/issues/108</a></div><br /></div>
2023-04-11T15:15:18.5387295Z Touchpoint id is: false
2023-04-11T15:15:18.5388152Z Creating touchpoint...
2023-04-11T15:15:18.9936940Z ##[error]Failed to create touchpoint: 401
2023-04-11T15:15:18.9956063Z /home/runner/work/_actions/jmassardo/issues-to-totango/version2.0/dist/index.js:55376
2023-04-11T15:15:18.9956771Z let touchpoint_id = (JSON.parse(response.body))['note']['id'];
2023-04-11T15:15:18.9957201Z ^
2023-04-11T15:15:18.9957445Z
2023-04-11T15:15:18.9957728Z TypeError: Cannot read properties of undefined (reading 'id')
2023-04-11T15:15:18.9958715Z at Request._callback (/home/runner/work/_actions/jmassardo/issues-to-totango/version2.0/dist/index.js:55376:64)
2023-04-11T15:15:18.9959441Z at Request.self.callback (/home/runner/work/_actions/jmassardo/issues-to-totango/version2.0/dist/index.js:24531:22)
2023-04-11T15:15:18.9959915Z at Request.emit (node:events:527:28)
2023-04-11T15:15:18.9960474Z at Request.<anonymous> (/home/runner/work/_actions/jmassardo/issues-to-totango/version2.0/dist/index.js:25500:10)
2023-04-11T15:15:18.9960920Z at Request.emit (node:events:527:28)
2023-04-11T15:15:18.9961524Z at IncomingMessage.<anonymous> (/home/runner/work/_actions/jmassardo/issues-to-totango/version2.0/dist/index.js:25422:12)
2023-04-11T15:15:18.9962013Z at Object.onceWrapper (node:events:641:28)
2023-04-11T15:15:18.9962405Z at IncomingMessage.emit (node:events:539:35)
2023-04-11T15:15:18.9962815Z at endReadableNT (node:internal/streams/readable:1345:12)
2023-04-11T15:15:18.9963305Z at processTicksAndRejections (node:internal/process/task_queues:83:21)
2023-04-11T15:15:19.0250489Z Cleaning up orphan processes
Version 2.0 does not catch authentication errors from Totango.
The call to Totango succeeds; however, the HTTP code returned is 401. We should be aware of this and give the user a human readable message with guidance on how to fix it.