Support specifying commit sha or commit URL when running "publish"
Is your feature request related to a problem? Please describe.
When we were using netlify to build we had convenient links from the deploys back to the commit that caused them. Now we are using GitHub actions and the Netlify CLI so we can coordinate the frontend deployment on Netlify with the backend deployment. We would like to be able to see those same links in the deploy log.
Describe the solution you'd like
I would like to be able to specify --commit-url ${GITHUB_COMMIT_URL} and see the familiar commit labeling in the deployments page on the netlify website.
Describe alternatives you've considered
We are using the description, but you can only put a short string there and it does not get turned into a link
Additional context
Can you submit a pull request?
No. I believe this would require changes to how Netlify stores this info/the Netlify API in addition to the change to the CLI
Pull requests are welcome! If you would like to help us add this feature, please check our contributions guidelines.
Hi @ForbesLindesay, thanks for opening this issue.
Could you use https://github.com/ouzi-dev/commit-status-updater to update the commit status?
The CLI triggers a deploy, but doesn't simulate the same mechanisms as the Netlify build system (this would require some thought on the responsibilities of each tool).
That's the inverse problem. I already add a status to the commit, which makes it easy to look at a commit and find the deployed website. I want to be able to look at the deployment history in Netlify and find the commit.
Oh, I get it now. Sorry I missed it initially. Let me look into it further as I believe this will require API support for it. Could also be related to https://github.com/netlify/cli/issues/177
Sorry for the late follow up, opened this related issue for our API https://github.com/netlify/js-client/issues/149
I would like to be able to specify --commit-url ${GITHUB_COMMIT_URL} and see the familiar commit labeling in the deployments page on the netlify website.
One question this raises for me is what information could be added to the website with only a commit URL. The SHA could be added with a link to open it, but a branch name would be absent, no?
If that's true, this ambiguity could cause some confusion. For example, if a commit is present on a feature branch and deployed, then the commit is merged to main and deployed. The deploys would look identical on the website but could have different commit histories. Leaving off a branch name would also make it inconsistent with Netlify CD.
So I've given this more thought. Ideally (and assuming API support), the CLI could auto magically do this for users.
- Detect it's running in a
gitrepo - Get current branch and commit SHA.
- Verify current branch and commit SHA exist on git remote.
- Send branch and commit SHA with deploy information to API.