Skip to content

Commit 303811c

Browse files
authored
Fix: [AEA-0000] - pin conventional-changelog-eslint and stop it updating automatically (#91)
1 parent e5a0d67 commit 303811c

File tree

3 files changed

+83
-42
lines changed

3 files changed

+83
-42
lines changed

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,66 @@ jobs:
1111
BRANCH_NAME: main
1212
secrets:
1313
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}
14+
15+
tag_release:
16+
needs: quality_checks
17+
runs-on: ubuntu-latest
18+
steps:
19+
- name: Checkout code
20+
uses: actions/checkout@v4
21+
with:
22+
ref: ${{ env.BRANCH_NAME }}
23+
fetch-depth: 0
24+
25+
# using git commit sha for version of action to ensure we have stable version
26+
- name: Install asdf
27+
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
28+
with:
29+
asdf_branch: v0.11.3
30+
31+
- name: Cache asdf
32+
uses: actions/cache@v4
33+
with:
34+
path: |
35+
~/.asdf
36+
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
37+
restore-keys: |
38+
${{ runner.os }}-asdf-
39+
40+
- name: Install asdf dependencies in .tool-versions
41+
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
42+
with:
43+
asdf_branch: v0.11.3
44+
env:
45+
PYTHON_CONFIGURE_OPTS: --enable-shared
46+
47+
- name: Install node packages
48+
run: |
49+
make install-node
50+
51+
- name: Set VERSION_TAG env var to be short git SHA and get next tag varsion
52+
id: output_version_tag
53+
run: |
54+
VERSION_TAG=$(git rev-parse --short HEAD)
55+
npx semantic-release --dry-run > semantic-release-output.log
56+
NEXT_VERSION=$(grep -i 'The next release version is' semantic-release-output.log | sed -E 's/.* ([[:digit:].]+)$/\1/')
57+
if [ -z "${NEXT_VERSION}" ]
58+
then
59+
echo "Could not get next tag. Here is the log from semantic-release"
60+
cat semantic-release-output.log
61+
exit 1
62+
fi
63+
tagFormat=$(jq -r .tagFormat .releaserc)
64+
if [ "${tagFormat}" = "null" ]
65+
then
66+
tagFormat="v\${version}"
67+
fi
68+
# disabling shellcheck as replace does not work
69+
# shellcheck disable=SC2001
70+
NEW_VERSION_TAG=$(echo "$tagFormat" | sed "s/\${version}/$NEXT_VERSION/")
71+
echo "## VERSION TAG : ${VERSION_TAG}" >> "$GITHUB_STEP_SUMMARY"
72+
echo "## NEXT TAG WILL BE : ${NEW_VERSION_TAG}" >> "$GITHUB_STEP_SUMMARY"
73+
echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_OUTPUT"
74+
echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_ENV"
75+
env:
76+
GITHUB_TOKEN: ${{ github.token }}

package-lock.json

Lines changed: 18 additions & 40 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,6 @@
2828
"@typescript-eslint/eslint-plugin": "^7.8.0",
2929
"@typescript-eslint/parser": "^7.8.0",
3030
"axios-mock-adapter": "^1.22.0",
31-
"conventional-changelog-eslint": "6.0.0",
3231
"eslint": "^8.57.0",
3332
"eslint-plugin-import-newlines": "^1.4.0",
3433
"jest": "^29.7.0",
@@ -42,7 +41,8 @@
4241
"dependencies": {
4342
"@aws-lambda-powertools/logger": "^2.1.0",
4443
"aws-lambda": "^1.0.7",
45-
"axios": "^1.6.8"
44+
"axios": "^1.6.8",
45+
"conventional-changelog-eslint": "5.0.0"
4646
},
4747
"bugs": {
4848
"url": "https://github.com/NHSDigital/nhs-eps-spine-client/issues"

0 commit comments

Comments
 (0)