Skip to content

Instantly share code, notes, and snippets.

@doug65536
Created August 22, 2024 15:51
Show Gist options
  • Save doug65536/6f31a8dbf70ded7199738c2f309eeb5e to your computer and use it in GitHub Desktop.
Save doug65536/6f31a8dbf70ded7199738c2f309eeb5e to your computer and use it in GitHub Desktop.
# Define the path to the certificate file
$certFilePath = "path\to\your\certificate.pem"
# Get the latest commit hash
$latestCommit = git rev-parse HEAD
# Check if the certificate file was changed in the latest commit
$changes = git diff --name-only HEAD~1..HEAD
if ($changes -contains $certFilePath) {
Write-Output "Certificate has changed, cherry-picking..."
git cherry-pick $latestCommit
} else {
Write-Output "No certificate changes."
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment