Skip to content

Commit

Permalink
updated plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
akshatnema committed Oct 26, 2024
1 parent 19fab83 commit 54ec2e8
Showing 1 changed file with 15 additions and 13 deletions.
28 changes: 15 additions & 13 deletions github-action/lib/bump-action-version.js
Original file line number Diff line number Diff line change
@@ -1,20 +1,22 @@
const fs = require('fs');
const path = require('path');

module.exports = async (pluginConfig, context) => {
const { nextRelease } = context;
const version = nextRelease.version;
module.exports = {
prepare: async (pluginConfig, context) => {
const { nextRelease } = context;
const version = nextRelease.version;

const templatePath = path.resolve(__dirname, '../../', 'action-template.yml');
const outputPath = path.resolve(__dirname, '../../', 'action.yml');
const templatePath = path.resolve(__dirname, '../../', 'action-template.yml');
const outputPath = path.resolve(__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;
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;
}
}
};

0 comments on commit 54ec2e8

Please sign in to comment.