diff --git a/github-action/lib/bump-action-version.js b/github-action/lib/bump-action-version.js index eb4f7b76ca2..31010b1e6d0 100644 --- a/github-action/lib/bump-action-version.js +++ b/github-action/lib/bump-action-version.js @@ -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; + } } };