Skip to content

Commit 749a316

Browse files
fix: Added changes in package.json and Updated scriot file
1 parent 09ba672 commit 749a316

File tree

3 files changed

+56
-46
lines changed

3 files changed

+56
-46
lines changed

package.json

+33
Original file line numberDiff line numberDiff line change
@@ -60,5 +60,38 @@
6060
},
6161
"engines": {
6262
"node": ">=10.12.0"
63+
},
64+
"release": {
65+
"branches": [
66+
"test_branch_actions",
67+
{
68+
"name": "beta",
69+
"prerelease": true
70+
}
71+
],
72+
"plugins": [
73+
"@semantic-release/commit-analyzer",
74+
"@semantic-release/release-notes-generator",
75+
[
76+
"@semantic-release/changelog",
77+
{
78+
"changelogFile": "CHANGES.md"
79+
}
80+
],
81+
[
82+
"@semantic-release/npm",
83+
{
84+
"npmPublish": false
85+
}
86+
],
87+
"@semantic-release/github",
88+
[
89+
"@semantic-release/git",
90+
{
91+
"assets": ["CHANGES.md", "package.json"],
92+
"message": "chore(release): set `package.json` to ${nextRelease.version} [skip ci]\n\n${nextRelease.notes}"
93+
}
94+
]
95+
]
6396
}
6497
}

release.config.js

-29
This file was deleted.

scripts/updateApiDefinitions.sh

+23-17
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ echo "Copying api-definitions"
33
cp -R ~/oai_definitions/json/. src/services/twilio-api/
44
echo "Running update changelog script"
55
changeLog=$(node scripts/update-api-definitions.js)
6-
changeLog="${changeLog//'%'/'%25'}"
7-
changeLog="${changeLog//$'\n'/'%0A'}"
8-
changeLog="${changeLog//$'\r'/'%0D'}"
9-
echo "CHANGE_LOG=$changeLog" >> $GITHUB_ENV
10-
# echo "::set-output name=changeLog::$changeLog"
6+
if [ "$changeLog" != '' ]; then
7+
changeLog="${changeLog//'%'/'%25'}"
8+
changeLog="${changeLog//$'\n'/'%0A'}"
9+
changeLog="${changeLog//$'\r'/'%0D'}"
10+
fi
1111
versionType=$(node scripts/get-version-type.js)
1212
echo "Version type: $versionType"
1313
rm -rf OAI_CHANGES.md
@@ -16,17 +16,23 @@ git config --global user.email "[email protected]"
1616
git config --global user.name "lakshmiravali"
1717
branch=$(git branch --show-current)
1818
echo "Current branch: $branch"
19-
git add .
20-
commitMessage=''
21-
if [ $versionType == 0 ] || [ $versionType == 1 ]
22-
then
23-
commitMessage='doc: Updated api definitions'
24-
elif [ $versionType == 2 ]
25-
then
26-
commitMessage='fix: Updated api definitions'
19+
git add -A
20+
if [ -n "$(git status --porcelain)" ]; then
21+
echo "There are changes to commit.";
22+
commitMessage=''
23+
if [ "$versionType" == 0 ] || [ "$versionType" == 1 ]
24+
then
25+
commitMessage='feat: Updated api definitions'
26+
elif [ "$versionType" == 2 ]
27+
then
28+
commitMessage='fix: Updated api definitions'
29+
else
30+
echo "Invalid versionType: $versionType";
31+
exit
32+
fi
33+
echo "Commit message:$commitMessage"
34+
git commit -m "$commitMessage"
35+
git push origin "$branch"
2736
else
28-
exit
37+
echo "No OpenAPI changes to commit";
2938
fi
30-
echo "Commit message:$commitMessage"
31-
git commit -m "$commitMessage"
32-
git push origin $branch

0 commit comments

Comments
 (0)