diff --git a/README.md b/README.md index 001321d..b7ceb48 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Monodeploy GitHub Actions plugin -This is a small plugin for [Monodeploy](https://github.com/tophat/monodeploy) that adds information about the release to `$GITHUB_OUTPUT`, for use with GitHub actions. This is useful for letting other actions/workflows depend on the result of a monodeploy run. For example, to only execute something if a release was done. +This is a small plugin for [Monodeploy](https://github.com/tophat/monodeploy) that adds information about whether a release happened to `$GITHUB_OUTPUT`, for use with GitHub actions. This is useful for letting other actions/workflows depend on the result of a monodeploy run. For example, to only execute something if a release was done. ## Usage @@ -28,7 +28,5 @@ module.exports = { - name: "Do something with output" if: steps.release.outputs.released == 'true' run: | - echo ${{ steps.release.outputs.lastVersion }} - echo ${{ steps.release.outputs.nextVersion }} - echo ${{ steps.release.outputs.releaseType }} + echo 'do something' ``` diff --git a/src/index.ts b/src/index.ts index 03d7a5a..fd2f734 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,11 +1,5 @@ -import * as os from "node:os"; import * as fs from "node:fs"; -import { - type PluginHooks, - type YarnContext, - type MonodeployConfiguration, - type ChangesetSchema, -} from "@monodeploy/types"; +import { type PluginHooks } from "@monodeploy/types"; // eslint-disable-next-line @typescript-eslint/naming-convention export const PluginName = "GitHub Actions Plugin"; @@ -14,25 +8,12 @@ export const PluginName = "GitHub Actions Plugin"; export default function GithubActionsPlugin({ onReleaseAvailable, }: Pick): void { - const outputReleaseInformation = async ( - context: YarnContext, - config: MonodeployConfiguration, - changeset: ChangesetSchema - ): Promise => { + const outputReleaseInformation = async (): Promise => { if (!process.env.GITHUB_OUTPUT) { return; } - const { lastRelease, nextRelease } = changeset; - - const output = [ - `released=true`, - `last-version=${lastRelease.version}`, - `next-version=${nextRelease.version}`, - `release-type=${nextRelease.strategy}`, - ].join(os.EOL); - - await fs.promises.appendFile(process.env.GITHUB_OUTPUT, output); + await fs.promises.appendFile(process.env.GITHUB_OUTPUT, "released=true"); }; onReleaseAvailable.tapPromise(PluginName, outputReleaseInformation);