File tree Expand file tree Collapse file tree 5 files changed +26
-52
lines changed
Expand file tree Collapse file tree 5 files changed +26
-52
lines changed Original file line number Diff line number Diff line change 6060 - name : " Repo setup"
6161 env :
6262 NODE_AUTH_TOKEN : ${{ secrets.GITHUB_TOKEN }}
63+ GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
6364 run : |
6465 npm ci
6566 - name : " Generate dependencies"
Load Diff This file was deleted.
Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+
3+ set -euo pipefail
4+
5+ published_version=$( npm view @nhsdigital/notify-supplier-api-consumer-contracts --json 2> /dev/null | jq -r ' .["dist-tags"].latest' )
6+
7+ # Fail if there are uncommitted changes as this indicates unexpected changes to the contracts
8+ git diff --quiet tests/pact-tests
9+
10+ local_version=$( cat pact-contracts/package.json | jq -r ' .version' )
11+
12+ branch=$( git branch --show-current)
13+
14+ if [[ ! $branch == " feature/CCM-13038_pact-tests" ]]; then
15+ echo " Not publishing package because this is not the main branch"
16+ exit 0
17+ fi
18+
19+ if [[ $local_version == $published_version ]]; then
20+ echo " Local version is the same as the latest published version - skipping publish"
21+ exit 0
22+ fi
23+
24+ echo " Local version is different to the latest published version - publishing new version"
25+ npm publish ./pact-contracts
You can’t perform that action at this time.
0 commit comments