-
-
Notifications
You must be signed in to change notification settings - Fork 170
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: changeset configuration and github action (#1590)
* updated commit for changeset config * updated changeset github workflow * updated version command in changeset action
- Loading branch information
1 parent
f61e8ed
commit 187e7eb
Showing
6 changed files
with
18 additions
and
287 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains 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
This file was deleted.
Oops, something went wrong.
This file contains 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,22 +1,18 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
|
||
module.exports = { | ||
prepare: async (pluginConfig, context) => { | ||
const { nextRelease } = context; | ||
const version = nextRelease.version; | ||
function bumpActionVersion() { | ||
const packageJsonPath = path.join(__dirname, '../../', 'package.json'); | ||
const packageJsonVersion = require(packageJsonPath).version; | ||
|
||
const templatePath = path.resolve(__dirname, '../../', 'action-template.yml'); | ||
const outputPath = path.resolve(__dirname, '../../', 'action.yml'); | ||
const templatePath = path.join(__dirname, '../../', 'action-template.yml'); | ||
const outputPath = path.join(__dirname, '../../', 'action.yml'); | ||
|
||
try { | ||
const templateContent = fs.readFileSync(templatePath, 'utf8'); | ||
const updatedContent = templateContent.replace(/\${ version }/g, version); | ||
fs.writeFileSync(outputPath, updatedContent, 'utf8'); | ||
console.log(`Updated action.yml with version ${version}`); | ||
} catch (error) { | ||
console.error('Error updating action.yml:', error); | ||
throw error; | ||
} | ||
} | ||
}; | ||
const templateContent = fs.readFileSync(templatePath, 'utf8'); | ||
const updatedContent = templateContent.replace(/\${ version }/g, packageJsonVersion); | ||
|
||
fs.writeFileSync(outputPath, updatedContent, 'utf8'); | ||
console.log(`Updated action.yml with version ${packageJsonVersion}`); | ||
} | ||
|
||
bumpActionVersion(); |
This file contains 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