Error
2021-05-19T08:42:17.954Z 224af88d-9a12-4579-839a-1e85e79cd7ac ERROR RequestError [HttpError]: Not Found
at /var/task/node_modules/@octokit/request/dist-node/index.js:68:23
at processTicksAndRejections (internal/process/task_queues.js:97:5)
at async Runtime.exports.handler (/var/task/WriteToGitHub.js:29:22) {
status: 404,
headers: {
'access-control-allow-origin': '*',
'access-control-expose-headers': 'ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Resource, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset',
connection: 'close',
'content-encoding': 'gzip',
'content-security-policy': "default-src 'none'",
'content-type': 'application/json; charset=utf-8',
date: 'Wed, 19 May 2021 08:42:17 GMT',
'referrer-policy': 'origin-when-cross-origin, strict-origin-when-cross-origin',
server: 'GitHub.com',
'strict-transport-security': 'max-age=31536000; includeSubdomains; preload',
'transfer-encoding': 'chunked',
vary: 'Accept-Encoding, Accept, X-Requested-With',
'x-accepted-oauth-scopes': 'repo',
'x-content-type-options': 'nosniff',
'x-frame-options': 'deny',
'x-github-media-type': 'github.v3; format=json',
'x-github-request-id': 'D7F8:1E3B:17DBF53:344F8DF:60A4CF69',
'x-oauth-scopes': 'admin:repo_hook, repo',
'x-ratelimit-limit': '5000',
'x-ratelimit-remaining': '4980',
'x-ratelimit-reset': '1621415637',
'x-ratelimit-resource': 'core',
'x-ratelimit-used': '20',
'x-xss-protection': '0'
},
request: {
method: 'PUT',
url: 'https://api.github.com/repos/shankey28/content-aggregator-example%5C/contents/%2Ffrontend%2Fcontent.json',
headers: {
accept: 'application/vnd.github.v3+json',
'user-agent': 'octokit-rest.js/18.5.3 octokit-core.js/3.4.0 Node.js/12.22.1 (linux; x64)',
authorization: 'token [REDACTED]',
'content-type': 'application/json; charset=utf-8'
},
body: '{REDACTED}',
request: { hook: [Function: bound bound register] }
},
documentation_url: 'https://docs.github.com/rest/reference/repos#create-or-update-file-contents'
}
Tried below options for environment variables:
Does not work:
GitHubRepo
- https://github.com/shankey28/content-aggregator-example
OR
- https://github.com/shankey28/content-aggregator-example\
JSONFILE (default in template.yml)
/frontend/content.json
Does work
GitHubRepo
https://github.com/shankey28/content-aggregator-example
JSONFile
frontend/content.json
Solution
Change the default value of JSONFile parameter in template.yml to 'frontend/content.json'