r/MicrosoftFabric • u/One-Barber-264 • 2d ago
CI/CD GitHub integration - Undo API call
I have been creating scripts for automated deployment using the git integration. Any change to the main branch automatically triggers the update of a workspace.
I have had some scenarios though were something goes wrong and I need to reset the workspace to re-sync with what is currently in the main branch in GitHub. I can manually use the Undo button, but I want to automate this step. Is there an API for that?

3
Upvotes
2
u/Environmental-Fun833 2d ago
Yep, there's an API for that. `POST /workspaces/{ws}/git/updateFromGit`. You'll use PreferRemote in this case.
{
"remoteCommitHash": "<from git/status>",
"workspaceHead": "<from git/status, omit on first sync>",
"conflictResolution": { "conflictResolutionType": "Workspace", "conflictResolutionPolicy": "PreferRemote" },
"options": { "allowOverrideItems": true }
}