Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor(preview-comment)!: deprecate subaction and link to sunsetting blog post #207

Merged
merged 1 commit into from
Feb 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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