Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions .github/workflows/pr_closed.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -54,3 +54,60 @@ jobs:
targetAccountGroup: "nhs-notify-template-management-dev"
targetComponent: ${{ matrix.component }}
terraformAction: "apply"

check-event-schemas-version-change:
name: Check for event schemas package version change
needs: check-merge-or-workflow-dispatch
if: needs.check-merge-or-workflow-dispatch.outputs.deploy == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: read
steps:
- name: Checkout code
uses: actions/checkout@v5.0.0

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.18.2'
registry-url: 'https://npm.pkg.github.com'

- name: check if local version differs from latest published version
run: |
published_version=$(npm view @nhsdigital/nhs-notify-event-schemas-template-management --json 2>/dev/null | jq -r '.["dist-tags"].latest')
local_version=$(cat packages/event-schemas/package.json | jq -r '.version')
if [[ $local_version = $published_version ]]; then
echo "Local version is the same as the latest published version - skipping publish"
echo "version_changed=false" >> $GITHUB_OUTPUT
else
echo "Local version is different to the latest published version - publishing new version"
echo "version_changed=true" >> $GITHUB_OUTPUT
fi

publish-event-schemas:
name: Publish event schemas package to GitHub package registry
needs: check-event-schemas-version-change
if: needs.check-event-schemas-version-change.outputs.version_changed == 'true'
runs-on: ubuntu-latest
permissions:
contents: read
packages: write

steps:
- name: Checkout code
uses: actions/checkout@v5.0.0

- name: Use Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20.18.2'
registry-url: 'https://npm.pkg.github.com'

- name: Install dependencies
run: npm ci

- name: Publish to GitHub Packages
run: npm publish --workspace packages/event-schemas
env:
NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ acceptance-test-report
# production
/build
dist
*.tgz

# misc
.DS_Store
Expand Down
11 changes: 6 additions & 5 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,14 @@
{
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.codeActionsOnSave.mode": "problems",
"eslint.useFlatConfig": false,
"markdownlint.config": {
"MD013": false,
"MD024": {
"siblings_only": true
},
"MD033": false
},
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"eslint.codeActionsOnSave.mode": "problems"
}
}
Loading