{"action":"created","issue":{"url":"https://api.github.com/repos/cypress-io/commit-info/issues/43","repository_url":"https://api.github.com/repos/cypress-io/commit-info","labels_url":"https://api.github.com/repos/cypress-io/commit-info/issues/43/labels{/name}","comments_url":"https://api.github.com/repos/cypress-io/commit-info/issues/43/comments","events_url":"https://api.github.com/repos/cypress-io/commit-info/issues/43/events","html_url":"https://github.com/cypress-io/commit-info/issues/43","id":367376192,"node_id":"MDU6SXNzdWUzNjczNzYxOTI=","number":43,"title":"Add fallback environment variables","user":{"login":"bahmutov","id":2212006,"node_id":"MDQ6VXNlcjIyMTIwMDY=","avatar_url":"https://avatars1.githubusercontent.com/u/2212006?v=4","gravatar_id":"","url":"https://api.github.com/users/bahmutov","html_url":"https://github.com/bahmutov","followers_url":"https://api.github.com/users/bahmutov/followers","following_url":"https://api.github.com/users/bahmutov/following{/other_user}","gists_url":"https://api.github.com/users/bahmutov/gists{/gist_id}","starred_url":"https://api.github.com/users/bahmutov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bahmutov/subscriptions","organizations_url":"https://api.github.com/users/bahmutov/orgs","repos_url":"https://api.github.com/users/bahmutov/repos","events_url":"https://api.github.com/users/bahmutov/events{/privacy}","received_events_url":"https://api.github.com/users/bahmutov/received_events","type":"User","site_admin":false},"labels":[{"id":733320054,"node_id":"MDU6TGFiZWw3MzMzMjAwNTQ=","url":"https://api.github.com/repos/cypress-io/commit-info/labels/enhancement","name":"enhancement","color":"84b6eb","default":true}],"state":"open","locked":false,"assignee":{"login":"bahmutov","id":2212006,"node_id":"MDQ6VXNlcjIyMTIwMDY=","avatar_url":"https://avatars1.githubusercontent.com/u/2212006?v=4","gravatar_id":"","url":"https://api.github.com/users/bahmutov","html_url":"https://github.com/bahmutov","followers_url":"https://api.github.com/users/bahmutov/followers","following_url":"https://api.github.com/users/bahmutov/following{/other_user}","gists_url":"https://api.github.com/users/bahmutov/gists{/gist_id}","starred_url":"https://api.github.com/users/bahmutov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bahmutov/subscriptions","organizations_url":"https://api.github.com/users/bahmutov/orgs","repos_url":"https://api.github.com/users/bahmutov/repos","events_url":"https://api.github.com/users/bahmutov/events{/privacy}","received_events_url":"https://api.github.com/users/bahmutov/received_events","type":"User","site_admin":false},"assignees":[{"login":"bahmutov","id":2212006,"node_id":"MDQ6VXNlcjIyMTIwMDY=","avatar_url":"https://avatars1.githubusercontent.com/u/2212006?v=4","gravatar_id":"","url":"https://api.github.com/users/bahmutov","html_url":"https://github.com/bahmutov","followers_url":"https://api.github.com/users/bahmutov/followers","following_url":"https://api.github.com/users/bahmutov/following{/other_user}","gists_url":"https://api.github.com/users/bahmutov/gists{/gist_id}","starred_url":"https://api.github.com/users/bahmutov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bahmutov/subscriptions","organizations_url":"https://api.github.com/users/bahmutov/orgs","repos_url":"https://api.github.com/users/bahmutov/repos","events_url":"https://api.github.com/users/bahmutov/events{/privacy}","received_events_url":"https://api.github.com/users/bahmutov/received_events","type":"User","site_admin":false}],"milestone":null,"comments":3,"created_at":"2018-10-05T21:35:19Z","updated_at":"2018-11-27T15:21:53Z","closed_at":null,"author_association":"COLLABORATOR","body":"For really weird environments (like Docker containers WITHOUT git), we can have fallback environment variables we can check if `git` calls fail. For example we could polyfill failed keys with these environment variables\r\n\r\n```\r\nbranch: COMMIT_INFO_BRANCH\r\nmessage: COMMIT_INFO_MESSAGE\r\nemail: COMMIT_INFO_EMAIL\r\nauthor: COMMIT_INFO_AUTHOR\r\nsha: COMMIT_INFO_SHA\r\nremote: COMMIT_INFO_REMOTE\r\n```\r\n\r\nthen anyone who is spawning a container can set these environment variables themselves and get useful info"},"comment":{"url":"https://api.github.com/repos/cypress-io/commit-info/issues/comments/442097443","html_url":"https://github.com/cypress-io/commit-info/issues/43#issuecomment-442097443","issue_url":"https://api.github.com/repos/cypress-io/commit-info/issues/43","id":442097443,"node_id":"MDEyOklzc3VlQ29tbWVudDQ0MjA5NzQ0Mw==","user":{"login":"jennifer-shehane","id":1271364,"node_id":"MDQ6VXNlcjEyNzEzNjQ=","avatar_url":"https://avatars1.githubusercontent.com/u/1271364?v=4","gravatar_id":"","url":"https://api.github.com/users/jennifer-shehane","html_url":"https://github.com/jennifer-shehane","followers_url":"https://api.github.com/users/jennifer-shehane/followers","following_url":"https://api.github.com/users/jennifer-shehane/following{/other_user}","gists_url":"https://api.github.com/users/jennifer-shehane/gists{/gist_id}","starred_url":"https://api.github.com/users/jennifer-shehane/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jennifer-shehane/subscriptions","organizations_url":"https://api.github.com/users/jennifer-shehane/orgs","repos_url":"https://api.github.com/users/jennifer-shehane/repos","events_url":"https://api.github.com/users/jennifer-shehane/events{/privacy}","received_events_url":"https://api.github.com/users/jennifer-shehane/received_events","type":"User","site_admin":false},"created_at":"2018-11-27T15:21:53Z","updated_at":"2018-11-27T15:21:53Z","author_association":"MEMBER","body":"@mshaaban088 This is a great idea to add to the documentation. \r\n\r\nI created a new issue in our [docs](https://github.com/cypress-io/cypress-documentation) to document collecting git info here: https://github.com/cypress-io/cypress-documentation/issues/1176. Our documentation is open source and contributions are welcome. 😄"}}
{"actor":{"display_login":"jennifer-shehane"}}