Merge branch 'master' into canon-improve-form-components

This commit is contained in:
Charles de Dreuille
2025-04-07 14:05:59 +02:00
39 changed files with 510 additions and 297 deletions
+11
View File
@@ -0,0 +1,11 @@
---
'@backstage/plugin-catalog-react': minor
'@backstage/plugin-catalog': minor
---
**BREAKING ALPHA**: `CatalogFilterBlueprint`, used in the new frontend system, is now exported under plugin-catalog-react instead of plugin-catalog.
```diff
+ import { CatalogFilterBlueprint } from '@backstage/plugin-catalog-react/alpha';
- import { CatalogFilterBlueprint } from '@backstage/plugin-catalog/alpha';
```
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/canon': patch
---
Improved Container styles, changing our max-width to 120rem and improving padding on smaller screens.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/canon': patch
---
Move styles to the root of the TextField component.
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/plugin-scaffolder-backend-module-github': patch
---
Add support to github:repo:create to allow branch updates
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/cli': patch
---
make certificate strings optional for Dev environments
+5
View File
@@ -0,0 +1,5 @@
---
'@backstage/canon': patch
---
We added a render prop to the Link component to make sure it can work with React Router.
@@ -1,99 +0,0 @@
import { PropsTable } from '@/components/PropsTable';
import { Snippet } from '@/components/Snippet';
import { Tabs } from '@/components/Tabs';
import { CodeBlock } from '@/components/CodeBlock';
import { FieldSnippet } from '@/snippets/stories-snippets';
import { BaseUI } from '@/components/HeadlessBanners/BaseUI';
import {
fieldRootPropDefs,
fieldLabelPropDefs,
fieldDescriptionPropDefs,
fieldErrorPropDefs,
} from './props';
# Field
A wrapper around `Input` or `Select` component to add label, description and error messages..
<Snippet
align="center"
py={4}
preview={<FieldSnippet story="Default" />}
code={`<Field />`}
/>
<Tabs.Root>
<Tabs.List>
<Tabs.Tab>Usage</Tabs.Tab>
<Tabs.Tab>Theming</Tabs.Tab>
</Tabs.List>
<Tabs.Panel>
<CodeBlock
code={`import { Field } from '@backstage/canon';
<Field.Root>
<Field.Label>Name</Field.Label>
<Input placeholder="Enter your name" />
<Field.Description>Visible on your profile</Field.Description>
<Field.Error />
</Field.Root>`}
/>
</Tabs.Panel>
<Tabs.Panel>
We recommend starting with our [global tokens](/theme/theming) to customize the library and align it with
your brand. For additional flexibility, you can use the provided class names for each element listed below.
<CodeBlock
code={`<Field.Root className='canon-FieldRoot'>
<Field.Label className='canon-FieldLabel' />
<Field.Description className='canon-FieldDescription' />
<Field.Error className='canon-FieldError' />
</Field.Root>`}
/>
</Tabs.Panel>
</Tabs.Root>
## API reference
<BaseUI href="https://base-ui.com/react/components/field" />
### Field.Root
Groups all parts of the field. Renders a `<div>` element.
<PropsTable data={fieldRootPropDefs} />
### Field.Label
An accessible label that is automatically associated with the field control. Renders a `<label>` element.
<PropsTable data={fieldLabelPropDefs} />
### Field.Description
A paragraph with additional information about the field. Renders a `<p>` element.
<PropsTable data={fieldDescriptionPropDefs} />
### Field.Error
An error message displayed if the field control fails validation. Renders a `<div>` element.
<PropsTable data={fieldErrorPropDefs} />
## Examples
### With Label and Description
Here's a simple input with a label and description.
<Snippet
align="center"
py={4}
open
preview={<FieldSnippet story="WithLabelAndDescription" />}
code={`<Field>
<Field.Label>Name</Field.Label>
<Field.Description>Visible on your profile</Field.Description>
<Input placeholder="Enter your name" />
</Field>`}
/>
@@ -1,69 +0,0 @@
import { classNamePropDefs, stylePropDefs } from '../../../../utils/propDefs';
import type { PropDef } from '../../../../utils/propDefs';
export const fieldRootPropDefs: Record<string, PropDef> = {
name: {
type: 'string',
responsive: false,
},
disabled: {
type: 'boolean',
responsive: false,
},
invalid: {
type: 'boolean',
responsive: false,
},
validate: {
type: 'enum',
values: ['(value) => string | string[] | null | Promise'],
responsive: false,
},
validationMode: {
type: 'enum',
values: ['onBlur', 'onChange'],
responsive: false,
},
validationDebounceTime: {
type: 'number',
responsive: false,
},
...classNamePropDefs,
...stylePropDefs,
};
export const fieldLabelPropDefs: Record<string, PropDef> = {
...classNamePropDefs,
...stylePropDefs,
};
export const fieldDescriptionPropDefs: Record<string, PropDef> = {
...classNamePropDefs,
...stylePropDefs,
};
export const fieldErrorPropDefs: Record<string, PropDef> = {
match: {
type: 'enum',
values: [
'badInput',
'customError',
'patternMismatch',
'rangeOverflow',
'rangeUnderflow',
'stepMismatch',
'tooLong',
'tooShort',
'typeMismatch',
'valid',
'valueMissing',
],
responsive: false,
},
forceShow: {
type: 'boolean',
responsive: false,
},
...classNamePropDefs,
...stylePropDefs,
};
@@ -2,19 +2,19 @@ import { PropsTable } from '@/components/PropsTable';
import { Snippet } from '@/components/Snippet';
import { Tabs } from '@/components/Tabs';
import { CodeBlock } from '@/components/CodeBlock';
import { InputSnippet } from '@/snippets/stories-snippets';
import { TextFieldSnippet } from '@/snippets/stories-snippets';
import { BaseUI } from '@/components/HeadlessBanners/BaseUI';
import { inputPropDefs } from './props';
# Input
# TextField
A input component tfor your forms.
A text field component for your forms.
<Snippet
align="center"
py={4}
preview={<InputSnippet story="Primary" />}
code={`<Input label="Name" placeholder="Enter your name" />`}
preview={<TextFieldSnippet story="WithLabel" />}
code={`<TextField label="Label" placeholder="Enter a URL" />`}
/>
<Tabs.Root>
@@ -24,9 +24,9 @@ A input component tfor your forms.
</Tabs.List>
<Tabs.Panel>
<CodeBlock
code={`import { Input } from '@backstage/canon';
code={`import { TextField } from '@backstage/canon';
<Input />
<TextField />
`}
/>
</Tabs.Panel>
@@ -34,30 +34,40 @@ A input component tfor your forms.
We recommend starting with our [global tokens](/theme/theming) to customize the library and align it with
your brand. For additional flexibility, you can use the provided class names for each element listed below.
<CodeBlock
code={`<Input className="canon-Input" />`}
code={`<TextField className="canon-TextField" />`}
/>
</Tabs.Panel>
</Tabs.Root>
## API reference
<BaseUI href="https://base-ui.com/react/components/input" />
<PropsTable data={inputPropDefs} />
## Examples
### Sizes
Here's a simple input with a label and description.
We support two different sizes: `small`, `medium`.
<Snippet
align="center"
py={4}
open
preview={<InputSnippet story="Sizes" />}
code={`<Grid>
<Input size="sm" placeholder="Small" />
<Input size="md" placeholder="Medium" />
</Grid>`}
preview={<TextFieldSnippet story="Sizes" />}
code={`<Flex direction="row" gap="4">
<TextField size="small" placeholder="Small" />
<TextField size="medium" placeholder="Medium" />
</Flex>`}
/>
### With description
Here's a simple TextField with a description.
<Snippet
align="center"
py={4}
open
preview={<TextFieldSnippet story="WithDescription" />}
code={`<TextField label="Label" description="Description" placeholder="Enter a URL" />`}
/>
@@ -4,10 +4,20 @@ import type { PropDef } from '../../../../utils/propDefs';
export const inputPropDefs: Record<string, PropDef> = {
size: {
type: 'enum',
values: ['sm', 'md'],
default: 'md',
values: ['small', 'medium'],
default: 'medium',
responsive: false,
},
label: {
type: 'string',
},
description: {
type: 'string',
},
name: {
type: 'string',
required: true,
},
...classNamePropDefs,
...stylePropDefs,
};
+4 -16
View File
@@ -5,12 +5,11 @@ import * as BoxStories from '../../../packages/canon/src/components/Box/Box.stor
import * as ButtonStories from '../../../packages/canon/src/components/Button/Button.stories';
import * as CheckboxStories from '../../../packages/canon/src/components/Checkbox/Checkbox.stories';
import * as ContainerStories from '../../../packages/canon/src/components/Container/Container.stories';
import * as FieldStories from '../../../packages/canon/src/components/Field/Field.stories';
import * as GridStories from '../../../packages/canon/src/components/Grid/Grid.stories';
import * as HeadingStories from '../../../packages/canon/src/components/Heading/Heading.stories';
import * as IconButtonStories from '../../../packages/canon/src/components/IconButton/IconButton.stories';
import * as IconStories from '../../../packages/canon/src/components/Icon/Icon.stories';
import * as InputStories from '../../../packages/canon/src/components/Input/Input.stories';
import * as TextFieldStories from '../../../packages/canon/src/components/TextField/TextField.stories';
import * as TextStories from '../../../packages/canon/src/components/Text/Text.stories';
import * as FlexStories from '../../../packages/canon/src/components/Flex/Flex.stories';
import * as SelectStories from '../../../packages/canon/src/components/Select/Select.stories';
@@ -62,12 +61,12 @@ export const FlexSnippet = ({ story }: { story: keyof typeof FlexStories }) => {
return StoryComponent ? <StoryComponent /> : null;
};
export const FieldSnippet = ({
export const TextFieldSnippet = ({
story,
}: {
story: keyof typeof FieldStories;
story: keyof typeof TextFieldStories;
}) => {
const stories = composeStories(FieldStories);
const stories = composeStories(TextFieldStories);
const StoryComponent = stories[story as keyof typeof stories];
return StoryComponent ? <StoryComponent /> : null;
@@ -109,17 +108,6 @@ export const IconSnippet = ({ story }: { story: keyof typeof IconStories }) => {
return StoryComponent ? <StoryComponent /> : null;
};
export const InputSnippet = ({
story,
}: {
story: keyof typeof InputStories;
}) => {
const stories = composeStories(InputStories);
const StoryComponent = stories[story as keyof typeof stories];
return StoryComponent ? <StoryComponent /> : null;
};
export const TextSnippet = ({ story }: { story: keyof typeof TextStories }) => {
const stories = composeStories(TextStories);
const StoryComponent = stories[story as keyof typeof stories];
+15 -2
View File
@@ -103,9 +103,22 @@
}
.canon-Container {
max-width: 75rem;
max-width: 120rem;
padding: 0 var(--canon-space-4);
margin: 0 auto;
padding: 0 1rem;
transition: padding .2s ease-in-out;
}
@media (width >= 640px) {
.canon-Container {
padding: 0 var(--canon-space-8);
}
}
@media (width >= 1024px) {
.canon-Container {
padding: 0 var(--canon-space-12);
}
}
.canon-Icon {
+15 -2
View File
@@ -1,5 +1,18 @@
.canon-Container {
max-width: 75rem;
max-width: 120rem;
padding: 0 var(--canon-space-4);
margin: 0 auto;
padding: 0 1rem;
transition: padding .2s ease-in-out;
}
@media (width >= 640px) {
.canon-Container {
padding: 0 var(--canon-space-8);
}
}
@media (width >= 1024px) {
.canon-Container {
padding: 0 var(--canon-space-12);
}
}
+15 -2
View File
@@ -9309,9 +9309,22 @@
}
.canon-Container {
max-width: 75rem;
max-width: 120rem;
padding: 0 var(--canon-space-4);
margin: 0 auto;
padding: 0 1rem;
transition: padding .2s ease-in-out;
}
@media (width >= 640px) {
.canon-Container {
padding: 0 var(--canon-space-8);
}
}
@media (width >= 1024px) {
.canon-Container {
padding: 0 var(--canon-space-12);
}
}
.canon-Icon {
+27
View File
@@ -17,6 +17,7 @@ import { RefAttributes } from 'react';
import type { RemixiconComponentType } from '@remixicon/react';
import { ScrollArea as ScrollArea_2 } from '@base-ui-components/react/scroll-area';
import { Tooltip as Tooltip_2 } from '@base-ui-components/react/tooltip';
import type { useRender } from '@base-ui-components/react/use-render';
// @public (undocumented)
export type AlignItems = 'stretch' | 'start' | 'center' | 'end';
@@ -698,6 +699,32 @@ export type JustifyContent =
| 'around'
| 'between';
// @public (undocumented)
export const Link: React_2.ForwardRefExoticComponent<
Omit<LinkProps, 'ref'> & React_2.RefAttributes<HTMLElement>
>;
// @public (undocumented)
export interface LinkProps extends useRender.ComponentProps<'a'> {
// (undocumented)
children: ReactNode;
// (undocumented)
className?: string;
// (undocumented)
style?: CSSProperties;
// (undocumented)
to?: string;
// (undocumented)
variant?:
| 'subtitle'
| 'body'
| 'caption'
| 'label'
| Partial<Record<Breakpoint, 'subtitle' | 'body' | 'caption' | 'label'>>;
// (undocumented)
weight?: 'regular' | 'bold' | Partial<Record<Breakpoint, 'regular' | 'bold'>>;
}
// @public (undocumented)
export const marginPropDefs: (spacingValues: string[]) => {
m: {
@@ -1,5 +1,18 @@
.canon-Container {
max-width: 75rem;
padding: 0 1rem;
max-width: 120rem;
padding: 0 var(--canon-space-4);
margin: 0 auto;
transition: padding 0.2s ease-in-out;
}
@media (min-width: 640px) {
.canon-Container {
padding: 0 var(--canon-space-8);
}
}
@media (min-width: 1024px) {
.canon-Container {
padding: 0 var(--canon-space-12);
}
}
@@ -19,6 +19,7 @@ import type { Meta, StoryObj } from '@storybook/react';
import { Link } from './Link';
import { Flex } from '../Flex';
import { Text } from '../Text';
import { Link as RouterLink, MemoryRouter } from 'react-router-dom';
const meta = {
title: 'Components/Link',
@@ -33,7 +34,7 @@ type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
href: 'https://canon.backstage.io',
to: 'https://canon.backstage.io',
children: 'Sign up for Backstage',
},
};
@@ -66,6 +67,7 @@ export const AllWeights: Story = {
export const Responsive: Story = {
args: {
...Default.args,
variant: {
xs: 'label',
md: 'body',
@@ -73,6 +75,23 @@ export const Responsive: Story = {
},
};
export const CustomRender: Story = {
render: () => {
return (
<Flex gap="4" direction="column" align="start">
<Link render={<RouterLink to="/catalog" />}>Go to Catalog</Link>
</Flex>
);
},
decorators: [
Story => (
<MemoryRouter>
<Story />
</MemoryRouter>
),
],
};
export const Playground: Story = {
args: {
...Default.args,
+18 -16
View File
@@ -15,41 +15,43 @@
*/
import React, { forwardRef } from 'react';
import { useRender } from '@base-ui-components/react/use-render';
import { useResponsiveValue } from '../../hooks/useResponsiveValue';
import clsx from 'clsx';
import type { LinkProps } from './types';
/** @public */
export const Link = forwardRef<HTMLAnchorElement, LinkProps>((props, ref) => {
export const Link = forwardRef<HTMLElement, LinkProps>((props, ref) => {
const {
children,
className,
variant = 'body',
weight = 'regular',
style,
className,
render = <a />,
...restProps
} = props;
// Get the responsive values for the variant and weight
const responsiveVariant = useResponsiveValue(variant);
const responsiveWeight = useResponsiveValue(weight);
const internalRef = React.useRef<HTMLElement | null>(null);
return (
<a
ref={ref}
className={clsx(
const { renderElement } = useRender({
render,
props: {
className: clsx(
'canon-Link',
responsiveVariant && `canon-Link--variant-${responsiveVariant}`,
responsiveWeight && `canon-Link--weight-${responsiveWeight}`,
className,
)}
style={style}
{...restProps}
>
{children}
</a>
);
),
responsiveVariant,
responsiveWeight,
...restProps,
},
refs: [ref, internalRef],
});
return renderElement();
});
Link.displayName = 'Link';
+3 -2
View File
@@ -16,11 +16,12 @@
import type { CSSProperties, ReactNode } from 'react';
import type { Breakpoint } from '../../types';
import type { useRender } from '@base-ui-components/react/use-render';
/** @public */
export interface LinkProps
extends React.AnchorHTMLAttributes<HTMLAnchorElement> {
export interface LinkProps extends useRender.ComponentProps<'a'> {
children: ReactNode;
to?: string;
variant?:
| 'subtitle'
| 'body'
@@ -31,6 +31,9 @@ export const Default: Story = {
args: {
name: 'url',
placeholder: 'Enter a URL',
style: {
maxWidth: '300px',
},
},
};
@@ -76,7 +79,7 @@ export const Sizes: Story = {
description: 'Description',
},
render: args => (
<Flex direction="row" gap="4">
<Flex direction="row" gap="4" style={{ width: '100%', maxWidth: '600px' }}>
<TextField {...args} size="small" />
<TextField {...args} size="medium" />
</Flex>
+1
View File
@@ -41,6 +41,7 @@ export * from './components/TextField';
export * from './components/Tooltip';
export * from './components/Menu';
export * from './components/ScrollArea';
export * from './components/Link';
export * from './components/Select';
// Types
@@ -195,8 +195,10 @@ DEPRECATION WARNING: React Router Beta is deprecated and support for it will be
? {
type: 'https',
options: {
cert: fullConfig.getString('app.https.certificate.cert'),
key: fullConfig.getString('app.https.certificate.key'),
cert: fullConfig.getOptionalString(
'app.https.certificate.cert',
),
key: fullConfig.getOptionalString('app.https.certificate.key'),
},
}
: {},
+14
View File
@@ -16,6 +16,20 @@ import { ResourcePermission } from '@backstage/plugin-permission-common';
import { RouteRef } from '@backstage/frontend-plugin-api';
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
// @alpha
export const CatalogFilterBlueprint: ExtensionBlueprint<{
kind: 'catalog-filter';
name: undefined;
params: {
loader: () => Promise<JSX.Element>;
};
output: ConfigurableExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>;
inputs: {};
config: {};
configInput: {};
dataRefs: never;
}>;
// @alpha (undocumented)
export const catalogReactTranslationRef: TranslationRef<
'catalog-react',
@@ -13,6 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { CatalogFilterBlueprint } from './CatalogFilterBlueprint';
export { EntityCardBlueprint } from './EntityCardBlueprint';
export { EntityContentBlueprint } from './EntityContentBlueprint';
export {
-15
View File
@@ -12,7 +12,6 @@ import { Entity } from '@backstage/catalog-model';
import { EntityCardType } from '@backstage/plugin-catalog-react/alpha';
import { EntityContentLayoutProps } from '@backstage/plugin-catalog-react/alpha';
import { EntityPredicate } from '@backstage/plugin-catalog-react/alpha';
import { ExtensionBlueprint } from '@backstage/frontend-plugin-api';
import { ExtensionDefinition } from '@backstage/frontend-plugin-api';
import { ExtensionInput } from '@backstage/frontend-plugin-api';
import { ExternalRouteRef } from '@backstage/frontend-plugin-api';
@@ -25,20 +24,6 @@ import { SearchResultItemExtensionPredicate } from '@backstage/plugin-search-rea
import { SearchResultListItemBlueprintParams } from '@backstage/plugin-search-react/alpha';
import { TranslationRef } from '@backstage/core-plugin-api/alpha';
// @alpha
export const CatalogFilterBlueprint: ExtensionBlueprint<{
kind: 'catalog-filter';
name: undefined;
params: {
loader: () => Promise<JSX.Element>;
};
output: ConfigurableExtensionDataRef<JSX_2.Element, 'core.reactElement', {}>;
inputs: {};
config: {};
configInput: {};
dataRefs: never;
}>;
// @alpha (undocumented)
export const catalogTranslationRef: TranslationRef<
'catalog',
@@ -1,16 +0,0 @@
/*
* Copyright 2024 The Backstage Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export { CatalogFilterBlueprint } from './CatalogFilterBlueprint';
+1 -1
View File
@@ -15,7 +15,7 @@
*/
import React from 'react';
import { CatalogFilterBlueprint } from './blueprints';
import { CatalogFilterBlueprint } from '@backstage/plugin-catalog-react/alpha';
const catalogTagCatalogFilter = CatalogFilterBlueprint.make({
name: 'tag',
-1
View File
@@ -16,5 +16,4 @@
export { default } from './plugin';
export * from './blueprints';
export * from './translation';
@@ -210,6 +210,7 @@ export function createGithubRepoCreateAction(options: {
squashMergeCommitMessage?: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK';
allowMergeCommit?: boolean;
allowAutoMerge?: boolean;
allowUpdateBranch?: boolean;
requireCodeOwnerReviews?: boolean;
bypassPullRequestAllowances?: {
users?: string[];
@@ -355,6 +356,7 @@ export function createPublishGithubAction(options: {
squashMergeCommitMessage?: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK';
allowMergeCommit?: boolean;
allowAutoMerge?: boolean;
allowUpdateBranch?: boolean;
sourcePath?: string;
bypassPullRequestAllowances?:
| {
@@ -189,6 +189,12 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
visibility: 'private',
});
@@ -211,6 +217,12 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
visibility: 'public',
});
@@ -234,6 +246,7 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
visibility: 'private',
});
@@ -258,10 +271,13 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
customElements: undefined,
visibility: 'private',
has_wiki: true,
has_projects: true,
has_issues: true,
has_wiki: undefined,
has_projects: undefined,
has_issues: undefined,
homepage: 'https://example.com',
});
await action.handler({
@@ -285,10 +301,13 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
visibility: 'private',
has_wiki: false,
has_projects: false,
has_issues: false,
has_wiki: undefined,
has_projects: undefined,
has_issues: undefined,
homepage: 'https://example.com',
});
await action.handler({
@@ -314,11 +333,13 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: 'https://example.com',
visibility: 'private',
custom_properties: {
foo: 'bar',
foo2: 'bar2',
},
});
});
@@ -345,6 +366,11 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
});
await action.handler({
@@ -367,6 +393,11 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
});
await action.handler({
@@ -390,6 +421,10 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
});
await action.handler({
@@ -414,9 +449,10 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
has_wiki: true,
has_projects: true,
has_issues: true,
allow_update_branch: false,
has_wiki: undefined,
has_projects: undefined,
has_issues: undefined,
});
await action.handler({
@@ -441,9 +477,11 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
has_wiki: false,
has_projects: false,
has_issues: false,
allow_update_branch: false,
has_wiki: undefined,
has_projects: undefined,
has_issues: undefined,
homepage: 'https://example.com',
});
// Custom properties on user repos should be ignored
@@ -471,6 +509,11 @@ describe('publish:github', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: 'https://example.com',
});
});
@@ -65,6 +65,7 @@ export function createPublishGithubAction(options: {
squashMergeCommitMessage?: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK';
allowMergeCommit?: boolean;
allowAutoMerge?: boolean;
allowUpdateBranch?: boolean;
sourcePath?: string;
bypassPullRequestAllowances?:
| {
@@ -156,6 +157,7 @@ export function createPublishGithubAction(options: {
squashMergeCommitMessage: inputProps.squashMergeCommitMessage,
allowRebaseMerge: inputProps.allowRebaseMerge,
allowAutoMerge: inputProps.allowAutoMerge,
allowUpdateBranch: inputProps.allowUpdateBranch,
sourcePath: inputProps.sourcePath,
collaborators: inputProps.collaborators,
hasProjects: inputProps.hasProjects,
@@ -210,6 +212,7 @@ export function createPublishGithubAction(options: {
squashMergeCommitMessage = 'COMMIT_MESSAGES',
allowRebaseMerge = true,
allowAutoMerge = false,
allowUpdateBranch = false,
collaborators,
hasProjects = undefined,
hasWiki = undefined,
@@ -258,6 +261,7 @@ export function createPublishGithubAction(options: {
squashMergeCommitMessage,
allowRebaseMerge,
allowAutoMerge,
allowUpdateBranch,
access,
collaborators,
hasProjects,
@@ -129,6 +129,12 @@ describe('github:repo:create examples', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
visibility: 'private',
});
});
@@ -157,6 +163,11 @@ describe('github:repo:create examples', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
visibility: 'private',
});
});
@@ -177,6 +188,7 @@ describe('github:repo:create examples', () => {
name: 'repo',
org: 'owner',
private: true,
description: undefined,
delete_branch_on_merge: false,
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
@@ -184,9 +196,13 @@ describe('github:repo:create examples', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
visibility: 'private',
has_issues: false, // disable issues
has_projects: undefined,
has_wiki: false, // disable wiki
homepage: undefined,
});
});
@@ -219,6 +235,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -260,6 +278,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -301,6 +321,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -342,6 +364,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -383,6 +407,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: false,
allow_rebase_merge: false,
allow_auto_merge: false,
@@ -424,6 +450,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'pull_request_title',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -465,6 +493,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'blank',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -506,6 +536,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: true,
@@ -547,6 +579,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -588,6 +622,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -629,6 +665,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -670,6 +708,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -711,6 +751,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -752,6 +794,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -793,6 +837,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -834,6 +880,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -875,6 +923,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -916,6 +966,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -957,6 +1009,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -998,6 +1052,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1039,6 +1095,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1080,6 +1138,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: false,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1121,6 +1181,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1162,6 +1224,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1203,6 +1267,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1244,6 +1310,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1285,6 +1353,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1326,6 +1396,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1367,6 +1439,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1408,6 +1482,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1449,6 +1525,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1490,6 +1568,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1531,6 +1611,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1572,6 +1654,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1613,6 +1697,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1654,6 +1740,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1695,6 +1783,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1736,6 +1826,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1777,6 +1869,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'pull_request_description',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: false,
allow_rebase_merge: false,
allow_auto_merge: false,
@@ -1818,6 +1912,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: false,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: false,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1859,6 +1955,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1900,6 +1998,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1941,6 +2041,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -1982,6 +2084,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -2023,6 +2127,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -2064,6 +2170,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -2105,6 +2213,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -2146,6 +2256,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: false,
allow_rebase_merge: true,
allow_auto_merge: true,
@@ -2187,6 +2299,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -2228,6 +2342,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -2269,6 +2385,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -2310,6 +2428,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -2351,6 +2471,8 @@ describe('github:repo:create examples', () => {
allow_squash_merge: true,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_update_branch: false,
custom_properties: undefined,
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
@@ -2390,6 +2512,8 @@ describe('github:repo:create examples', () => {
private: true,
delete_branch_on_merge: false,
allow_squash_merge: true,
allow_update_branch: false,
custom_properties: undefined,
squash_merge_commit_title: 'COMMIT_OR_PR_TITLE',
squash_merge_commit_message: 'COMMIT_MESSAGES',
allow_merge_commit: true,
@@ -991,4 +991,19 @@ export const examples: TemplateExample[] = [
],
}),
},
{
description: 'Allow branch updates.',
example: yaml.stringify({
steps: [
{
action: 'github:repo:create',
name: 'Create a new GitHub repository allowing branch updates',
input: {
repoUrl: 'github.com?repo=repo&owner=owner',
allowUpdateBranch: true,
},
},
],
}),
},
];
@@ -137,6 +137,11 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
visibility: 'private',
});
@@ -159,6 +164,12 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
visibility: 'public',
});
@@ -182,6 +193,10 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
visibility: 'private',
});
@@ -206,10 +221,13 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
visibility: 'private',
has_wiki: true,
has_projects: true,
has_issues: true,
has_wiki: undefined,
has_projects: undefined,
has_issues: undefined,
homepage: 'https://example.com',
});
await action.handler({
@@ -233,10 +251,12 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
visibility: 'private',
has_wiki: false,
has_projects: false,
has_issues: false,
has_wiki: undefined,
has_projects: undefined,
has_issues: undefined,
});
await action.handler({
@@ -262,11 +282,13 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
custom_properties: undefined,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: 'https://example.com',
visibility: 'private',
custom_properties: {
foo: 'bar',
foo2: 'bar2',
},
});
});
@@ -293,6 +315,11 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
});
await action.handler({
@@ -315,6 +342,11 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: undefined,
});
await action.handler({
@@ -338,6 +370,10 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
});
await action.handler({
@@ -362,9 +398,11 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
has_wiki: true,
has_projects: true,
has_issues: true,
allow_update_branch: false,
has_wiki: undefined,
has_projects: undefined,
has_issues: undefined,
homepage: 'https://example.com',
});
await action.handler({
@@ -389,9 +427,11 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
has_wiki: false,
has_projects: false,
has_issues: false,
allow_update_branch: false,
has_wiki: undefined,
has_projects: undefined,
has_issues: undefined,
homepage: 'https://example.com',
});
// Custom properties on user repos should be ignored
@@ -419,6 +459,11 @@ describe('github:repo:create', () => {
allow_merge_commit: true,
allow_rebase_merge: true,
allow_auto_merge: false,
allow_update_branch: false,
has_issues: undefined,
has_projects: undefined,
has_wiki: undefined,
homepage: 'https://example.com',
});
});
@@ -55,6 +55,7 @@ export function createGithubRepoCreateAction(options: {
squashMergeCommitMessage?: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK';
allowMergeCommit?: boolean;
allowAutoMerge?: boolean;
allowUpdateBranch?: boolean;
requireCodeOwnerReviews?: boolean;
bypassPullRequestAllowances?: {
users?: string[];
@@ -130,6 +131,7 @@ export function createGithubRepoCreateAction(options: {
squashMergeCommitMessage: inputProps.squashMergeCommitMessage,
allowRebaseMerge: inputProps.allowRebaseMerge,
allowAutoMerge: inputProps.allowAutoMerge,
allowUpdateBranch: inputProps.allowUpdateBranch,
collaborators: inputProps.collaborators,
hasProjects: inputProps.hasProjects,
hasWiki: inputProps.hasWiki,
@@ -167,6 +169,7 @@ export function createGithubRepoCreateAction(options: {
squashMergeCommitMessage = 'COMMIT_MESSAGES',
allowRebaseMerge = true,
allowAutoMerge = false,
allowUpdateBranch = false,
collaborators,
hasProjects = undefined,
hasWiki = undefined,
@@ -213,6 +216,7 @@ export function createGithubRepoCreateAction(options: {
squashMergeCommitMessage,
allowRebaseMerge,
allowAutoMerge,
allowUpdateBranch,
access,
collaborators,
hasProjects,
@@ -44,6 +44,7 @@ export async function createGithubRepoWithCollaboratorsAndTopics(
squashMergeCommitMessage: 'PR_BODY' | 'COMMIT_MESSAGES' | 'BLANK' | undefined,
allowRebaseMerge: boolean,
allowAutoMerge: boolean,
allowUpdateBranch: boolean,
access: string | undefined,
collaborators:
| (
@@ -103,6 +104,7 @@ export async function createGithubRepoWithCollaboratorsAndTopics(
squash_merge_commit_message: squashMergeCommitMessage,
allow_rebase_merge: allowRebaseMerge,
allow_auto_merge: allowAutoMerge,
allow_update_branch: allowUpdateBranch,
homepage: homepage,
has_projects: hasProjects,
has_wiki: hasWiki,
@@ -121,6 +123,7 @@ export async function createGithubRepoWithCollaboratorsAndTopics(
squash_merge_commit_message: squashMergeCommitMessage,
allow_rebase_merge: allowRebaseMerge,
allow_auto_merge: allowAutoMerge,
allow_update_branch: allowUpdateBranch,
homepage: homepage,
has_projects: hasProjects,
has_wiki: hasWiki,
@@ -111,6 +111,12 @@ const allowSquashMerge = {
default: true,
description: 'Allow squash merges. The default value is `true`',
};
const allowUpdateBranch = {
title: 'Allow Update Branch',
type: 'boolean',
default: false,
description: 'Allow branch to be updated. The default value is `false`',
};
const squashMergeCommitTitle = {
title: 'Default squash merge commit title',
enum: ['PR_TITLE', 'COMMIT_OR_PR_TITLE'],
@@ -364,6 +370,7 @@ export { allowSquashMerge };
export { squashMergeCommitTitle };
export { squashMergeCommitMessage };
export { allowAutoMerge };
export { allowUpdateBranch };
export { collaborators };
export { defaultBranch };
export { deleteBranchOnMerge };