Skip to content

Commit

Permalink
Fix: [AEA-0000] - pin conventional-changelog-eslint and stop it updat…
Browse files Browse the repository at this point in the history
…ing automatically (#91)
  • Loading branch information
anthony-nhs authored May 9, 2024
1 parent e5a0d67 commit 303811c
Show file tree
Hide file tree
Showing 3 changed files with 83 additions and 42 deletions.
63 changes: 63 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,3 +11,66 @@ jobs:
BRANCH_NAME: main
secrets:
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }}

tag_release:
needs: quality_checks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
ref: ${{ env.BRANCH_NAME }}
fetch-depth: 0

# using git commit sha for version of action to ensure we have stable version
- name: Install asdf
uses: asdf-vm/actions/setup@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
with:
asdf_branch: v0.11.3

- name: Cache asdf
uses: actions/cache@v4
with:
path: |
~/.asdf
key: ${{ runner.os }}-asdf-${{ hashFiles('**/.tool-versions') }}
restore-keys: |
${{ runner.os }}-asdf-
- name: Install asdf dependencies in .tool-versions
uses: asdf-vm/actions/install@05e0d2ed97b598bfce82fd30daf324ae0c4570e6
with:
asdf_branch: v0.11.3
env:
PYTHON_CONFIGURE_OPTS: --enable-shared

- name: Install node packages
run: |
make install-node
- name: Set VERSION_TAG env var to be short git SHA and get next tag varsion
id: output_version_tag
run: |
VERSION_TAG=$(git rev-parse --short HEAD)
npx semantic-release --dry-run > semantic-release-output.log
NEXT_VERSION=$(grep -i 'The next release version is' semantic-release-output.log | sed -E 's/.* ([[:digit:].]+)$/\1/')
if [ -z "${NEXT_VERSION}" ]
then
echo "Could not get next tag. Here is the log from semantic-release"
cat semantic-release-output.log
exit 1
fi
tagFormat=$(jq -r .tagFormat .releaserc)
if [ "${tagFormat}" = "null" ]
then
tagFormat="v\${version}"
fi
# disabling shellcheck as replace does not work
# shellcheck disable=SC2001
NEW_VERSION_TAG=$(echo "$tagFormat" | sed "s/\${version}/$NEXT_VERSION/")
echo "## VERSION TAG : ${VERSION_TAG}" >> "$GITHUB_STEP_SUMMARY"
echo "## NEXT TAG WILL BE : ${NEW_VERSION_TAG}" >> "$GITHUB_STEP_SUMMARY"
echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_OUTPUT"
echo "VERSION_TAG=${VERSION_TAG}" >> "$GITHUB_ENV"
env:
GITHUB_TOKEN: ${{ github.token }}
58 changes: 18 additions & 40 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"@typescript-eslint/eslint-plugin": "^7.8.0",
"@typescript-eslint/parser": "^7.8.0",
"axios-mock-adapter": "^1.22.0",
"conventional-changelog-eslint": "6.0.0",
"eslint": "^8.57.0",
"eslint-plugin-import-newlines": "^1.4.0",
"jest": "^29.7.0",
Expand All @@ -42,7 +41,8 @@
"dependencies": {
"@aws-lambda-powertools/logger": "^2.1.0",
"aws-lambda": "^1.0.7",
"axios": "^1.6.8"
"axios": "^1.6.8",
"conventional-changelog-eslint": "5.0.0"
},
"bugs": {
"url": "https://github.com/NHSDigital/nhs-eps-spine-client/issues"
Expand Down

0 comments on commit 303811c

Please sign in to comment.