-
Notifications
You must be signed in to change notification settings - Fork 63
42 lines (39 loc) · 1.48 KB
/
unreleaseChangesCheck.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
on:
schedule:
- cron: '30 16 * * 1-5' # Run Monday through Friday at 9:30am
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Always checkout the main branch
ref: main
# Do a deep checkout
fetch-depth: 0
# Fetch all the release tags
fetch-tags: true
- name: Check for unreleased changes
id: get-diff-log
run: |
export MOST_RECENT_TAG=$(git describe --tags --abbrev=0);
echo $MOST_RECENT_TAG
export LOG=`git log $MOST_RECENT_TAG..main --pretty=format:'- %s – @%al.' --no-merges`
echo $LOG
echo "MOST_RECENT_TAG<<EOF" >> $GITHUB_ENV
echo $MOST_RECENT_TAG >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
echo "LOG<<EOF" >> $GITHUB_ENV
echo "$LOG" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Unreleased changes Slack Report
uses: ravsamhq/notify-slack-action@v2
if: ${{ env.LOG != '' }} # Only post if there is a log
with:
status: ${{ job.status }}
notify_when: 'success'
notification_title: 'Unreleased Changes in the CLI'
message_format: '${{ env.LOG }}'
footer: '<{run_url}|View Run> | <https://github.com/HubSpot/hubspot-cli/compare/${{env.MOST_RECENT_TAG}}...main|View in GitHub>'
env:
SLACK_WEBHOOK_URL: ${{ secrets.ACTION_MONITORING_SLACK }}