I’m using slack orb to create a deployment message that will be sent to a channel on success.
My job is all set and I was able to actually send a message, but when adding the
git diff command I always get this error:
fatal: ambiguous argument 'prod..main': unknown revision or path not in the working tree.
here’s how my job looks like:
notify: docker: - image: 'cimg/base:stable' steps: - checkout - run: name: Checkout branches and generate commit message command: | git clone $CIRCLE_REPOSITORY_URL myrepo cd myrepo git checkout main git pull git checkout prod git pull echo 'export COMMIT_MESSAGE="$(git log --pretty=format:"%s (%ad)" --date=short prod..main)"' >> $BASH_ENV - slack/notify: event: pass channel: $SLACK_LINGO_CHANNEL custom: //custom blocks with $COMMIT_MESSAGE in it
so what am I doing wrong here? shouldn’t the docker environment be able to see the diff between the two branches? would appreciate any help, thanks!