Skip to content

Commit b5a00af

Browse files
authored
Merge pull request #19 from dxfrontier/refactor/messages
Refactor/messages
2 parents 70e9c8f + 7d67927 commit b5a00af

5 files changed

Lines changed: 9 additions & 44 deletions

File tree

.github/workflows/deployment.yml

Lines changed: 1 addition & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -21,21 +21,11 @@ jobs:
2121
- run: |
2222
echo The PR was merged.
2323
24-
# This will validate to see if the labels contains 'none' which means that if 'none' was found the release will not happen
25-
check_valid_deploy:
26-
name: Validate deploy conditions
27-
needs: check_valid_merge
28-
if: ${{ contains(github.event.pull_request.labels.*.name, 'deploy') }}
29-
runs-on: ubuntu-latest
30-
steps:
31-
- run: |
32-
echo The PR can continue to deploy the version.
33-
3424
# This will start build of the project
3525
check_valid_build:
3626
name: Check build validity
3727
runs-on: ubuntu-latest
38-
needs: [check_valid_deploy]
28+
needs: check_valid_merge
3929
steps:
4030
- uses: actions/checkout@v4
4131
- run: npm install
@@ -60,25 +50,3 @@ jobs:
6050
- run: npm publish --access public
6151
env:
6252
NODE_AUTH_TOKEN: ${{secrets.NPM_ORG_TOKEN}}
63-
64-
publish-npm-github:
65-
name: Publish to github npm - internal
66-
needs: check_valid_build
67-
env:
68-
NPM_TOKEN: ${{ secrets.GITHUB_TOKEN }}
69-
runs-on: ubuntu-latest
70-
permissions:
71-
contents: read
72-
packages: write
73-
steps:
74-
- uses: actions/checkout@v4
75-
- uses: actions/setup-node@v4
76-
with:
77-
node-version: '20.x'
78-
registry-url: 'https://npm.pkg.github.com'
79-
- run: npm ci
80-
- run: npm run build
81-
- run: |
82-
echo @dxfrontier:registry=https://npm.pkg.github.com/ > ~/.npmrc
83-
echo "//npm.pkg.github.com/:_authToken=${NPM_TOKEN}" >> ~/.npmrc
84-
- run: npm publish

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,6 @@ jobs:
131131
token: ${{ secrets.GITHUB_TOKEN }}
132132
title: CHANGELOG.md updated
133133
body: CHANGELOG.md updated with latest conventional commits.
134-
labels: norelease, deploy
134+
labels: norelease
135135
env:
136136
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

lib/util/util.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,15 +11,12 @@ export const util = {
1111
},
1212

1313
createMessage(success: boolean, fileName: string) {
14-
const status = success ? colors.green : colors.red;
14+
const prefix = success ? colors.green('[SUCCESS]') : colors.red('[FAIL]');
15+
const syncStatus = success ? 'successfully' : 'not successfully';
1516

1617
return {
17-
message: status(
18-
`The version in ${fileName} has ${success ? '' : 'not '}been successfully synchronized with the main ${'package.json'} version.`,
19-
),
20-
messageAll: status(
21-
`All ${`*.${fileName}`} files have ${success ? '' : 'not '}been successfully synchronized with the main ${'package.json'} version.`,
22-
),
18+
message: `${prefix} - The version in ${fileName} has been ${syncStatus} synchronized with the main package.json version.`,
19+
messageAll: `${prefix} - All *.${fileName} files have been ${syncStatus} synchronized with the main package.json version.`,
2320
};
2421
},
2522

package-lock.json

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

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@dxfrontier/sync-mta-version",
3-
"version": "0.2.0",
3+
"version": "0.2.1",
44
"license": "MIT",
55
"description": "The goal of sync-mta-version is to update the mta.yaml with the version from the package.json",
66
"repository": {

0 commit comments

Comments
 (0)