Skip to content

Commit

Permalink
refactor(preview-comment): add deprecation notice with blog post
Browse files Browse the repository at this point in the history
  • Loading branch information
byCedric committed Feb 17, 2023
1 parent b1a8c06 commit 42fe5e5
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 1 deletion.
1 change: 1 addition & 0 deletions build/preview-comment/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -20780,6 +20780,7 @@ function commentInput() {
}
executeAction(commentAction);
async function commentAction(input = commentInput()) {
(0,core.warning)('Expo publish is deprecated, but will be suported until 2024. Read more: https://blog.expo.dev/sunsetting-expo-publish-and-classic-updates-6cb9cd295378');
const project = await projectInfo(input.project);
if (!project.owner) {
project.owner = await projectOwner();
Expand Down
2 changes: 2 additions & 0 deletions preview-comment/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@

<br />

> Expo publish is deprecated, but will be supported until 2024. ([read more](https://blog.expo.dev/sunsetting-expo-publish-and-classic-updates-6cb9cd295378))
## What's inside?

This (sub)action allows you to comment on pull requests containing Expo QR codes.
Expand Down
6 changes: 5 additions & 1 deletion src/actions/preview-comment.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { getBooleanInput, getInput, setOutput, info } from '@actions/core';
import { getBooleanInput, getInput, setOutput, info, warning } from '@actions/core';

import { projectDeepLink, projectInfo, projectLink, projectOwner, projectQR } from '../expo';
import { createIssueComment, pullContext } from '../github';
Expand Down Expand Up @@ -26,6 +26,10 @@ export function commentInput() {
executeAction(commentAction);

export async function commentAction(input = commentInput()) {
warning(
'Expo publish is deprecated, but will be suported until 2024. Read more: https://blog.expo.dev/sunsetting-expo-publish-and-classic-updates-6cb9cd295378'
);

const project = await projectInfo(input.project);
if (!project.owner) {
project.owner = await projectOwner();
Expand Down
7 changes: 7 additions & 0 deletions tests/actions/preview-comment.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,13 @@ describe(commentAction, () => {
jest.mocked(expo.projectOwner).mockResolvedValue('fakeuser');
});

it('warns users for deprecated publish', async () => {
await commentAction({ ...input });
expect(core.warning).toBeCalledWith(
'Expo publish is deprecated, but will be suported until 2024. Read more: https://blog.expo.dev/sunsetting-expo-publish-and-classic-updates-6cb9cd295378'
);
});

it('resolves project info by project path', async () => {
await commentAction({ ...input, project: 'fake/path' });
expect(expo.projectInfo).toBeCalledWith('fake/path');
Expand Down

0 comments on commit 42fe5e5

Please sign in to comment.