Skip to content

Commit

Permalink
refactor syntax
Browse files Browse the repository at this point in the history
  • Loading branch information
siggerzz committed Feb 9, 2024
1 parent 15f6f20 commit 1b4abd9
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/changeset-snapshot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
6 changes: 1 addition & 5 deletions .github/workflows/changeset-snapshot/create-and-publish.mjs
Original file line number Diff line number Diff line change
@@ -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');
Expand Down Expand Up @@ -71,7 +71,3 @@ yarn up ${newTags[0]}
body,
});
};

export {
createAndPublish
}
Original file line number Diff line number Diff line change
@@ -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;
Expand Down

0 comments on commit 1b4abd9

Please sign in to comment.