#!/bin/bash # Posts a git diff to MS Team Channel using webhooks # # Usage: # Make sure jq and curl are installed. # Save this script in /var/lib/oxidized/extra/ # Add to oxidized config: # # hooks: # ms_teams_webhook: # type: exec # events: [post_store] # cmd: '/var/lib/oxidized/extra/gitdiff-msteams.sh' # async: true # timeout: 120 # # Add webhook to your MS Teams channel and set the next variable to the full url weburl="https://contoso.webhook.office.com/webhookb2/etc etc etc" postdata() { COMMIT=$(git --bare --git-dir="${OX_REPO_NAME}" show --pretty='' --no-color "${OX_REPO_COMMITREF}" | jq --raw-input --slurp --compact-output) cat <