diff --git a/.github/workflows/changeset-snapshot.yml b/.github/workflows/changeset-snapshot.yml index d6e68c7618..96d12f63ac 100644 --- a/.github/workflows/changeset-snapshot.yml +++ b/.github/workflows/changeset-snapshot.yml @@ -140,7 +140,7 @@ jobs: github-token: ${{ secrets.CHANGESETS_TOKEN }} script: | const execa = require('execa'); - import { createAndPublish } from './.github/workflows/changeset-snapshot/create-and-publish.mjs'; + const { default: createAndPublish } = await import('${{ github.workspace }}/.github/workflows/changeset-snapshot/create-and-publish.mjs';') await createAndPublish({ github, context }, execa); diff --git a/.github/workflows/changeset-snapshot/create-and-publish.mjs b/.github/workflows/changeset-snapshot/create-and-publish.mjs index ef80a8e96f..94d6e61133 100644 --- a/.github/workflows/changeset-snapshot/create-and-publish.mjs +++ b/.github/workflows/changeset-snapshot/create-and-publish.mjs @@ -1,7 +1,7 @@ import { Octokit } from '@octokit/rest'; import fetch from 'node-fetch'; -const createAndPublish = async ({ github, context }, execa) => { +export default async function createAndPublish ({ github, context }, execa) { await execa.command('yarn changeset:version --snapshot snapshot-release', { stdio: 'inherit' }); const releaseProcess = execa.command('yarn changeset:publish --no-git-tags --snapshot --tag snapshot-release'); @@ -71,7 +71,3 @@ yarn up ${newTags[0]} body, }); }; - -export { - createAndPublish -} \ No newline at end of file diff --git a/.github/workflows/changeset-snapshot/test/create-and-publish.spec.js b/.github/workflows/changeset-snapshot/test/create-and-publish.spec.js index 1b03650f98..71907686e6 100644 --- a/.github/workflows/changeset-snapshot/test/create-and-publish.spec.js +++ b/.github/workflows/changeset-snapshot/test/create-and-publish.spec.js @@ -1,5 +1,5 @@ import { beforeEach, describe, expect, test, vi } from 'vitest'; -import { createAndPublish } from '../create-and-publish.mjs'; +import createAndPublish from '../create-and-publish.mjs'; import { Readable } from 'stream'; let context;