generated from NHSDigital/nhs-notify-repository-template
-
Notifications
You must be signed in to change notification settings - Fork 1
CCM-11026: publish event schemas #610
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
c7c63d7
CCM-11025: add schemas package
harrim91 706a8d0
CCM-11025: linting
harrim91 c8b3f1b
CCM-11025: workflow permissions
harrim91 d3858ab
CCM-11026: tinker
harrim91 9cc61e7
CCM-11026: plug package into event publisher
harrim91 4bf695e
CCM-11026: add version to event files, add jsonschema tests
harrim91 294a753
Merge branch 'main' into feature/CCM-11026_publish-event-schemas
harrim91 5cb2e09
CCM-11026: publish on merge
harrim91 3f5ce0e
CCM-11026: typo
harrim91 c3794c9
CCM-11026: PR feedbacks
harrim91 b62478f
CCM-11026: update example event message content
harrim91 05987ff
CCM-11026: add personalisation params to letter events
harrim91 5c33780
CCM-11026: fix typecheck config error
harrim91 733fe9c
Merge branch 'main' into feature/CCM-11026_publish-event-schemas
harrim91 5a104eb
CCM-11026: don't format schemas in pre-commit
harrim91 5001739
Merge branch 'main' into feature/CCM-11026_publish-event-schemas
harrim91 3baed10
Merge branch 'main' into feature/CCM-11026_publish-event-schemas
harrim91 a8567bf
CCM-11026: tidy package lock
harrim91 75c87b9
CCM-11026: typecheck fixes
harrim91 fc94cb9
Merge branch 'main' into feature/CCM-11026_publish-event-schemas
harrim91 25e2c9b
CCM-11026: bump checkout action version
harrim91 157a981
Merge branch 'main' into feature/CCM-11026_publish-event-schemas
harrim91 4f1a71e
Merge branch 'main' into feature/CCM-11026_publish-event-schemas
chris-elliott-nhsd File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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/[email protected] | ||
|
|
||
| - 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/[email protected] | ||
|
|
||
| - 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 }} | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -34,6 +34,7 @@ node_modules | |
| # production | ||
| /build | ||
| dist | ||
| *.tgz | ||
|
|
||
| # misc | ||
| .DS_Store | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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" | ||
| } | ||
| } |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.