-
Notifications
You must be signed in to change notification settings - Fork 16.4k
Expand file tree
/
Copy pathExistingWorkflowStep.tsx
More file actions
59 lines (51 loc) · 1.68 KB
/
Copy pathExistingWorkflowStep.tsx
File metadata and controls
59 lines (51 loc) · 1.68 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { Select } from 'src/components/CustomSelect/index.js';
import { Box, Text } from '@anthropic/ink';
interface ExistingWorkflowStepProps {
repoName: string;
onSelectAction: (action: 'update' | 'skip' | 'exit') => void;
}
export function ExistingWorkflowStep({ repoName, onSelectAction }: ExistingWorkflowStepProps) {
const options = [
{
label: 'Update workflow file with latest version',
value: 'update',
},
{
label: 'Skip workflow update (configure secrets only)',
value: 'skip',
},
{
label: 'Exit without making changes',
value: 'exit',
},
];
const handleSelect = (value: string) => {
onSelectAction(value as 'update' | 'skip' | 'exit');
};
const handleCancel = () => {
onSelectAction('exit');
};
return (
<Box flexDirection="column" borderStyle="round" borderDimColor paddingX={1}>
<Box flexDirection="column" marginBottom={1}>
<Text bold>Existing Workflow Found</Text>
<Text dimColor>Repository: {repoName}</Text>
</Box>
<Box flexDirection="column" marginBottom={1}>
<Text>
A Claude workflow file already exists at <Text color="claude">.github/workflows/claude.yml</Text>
</Text>
<Text dimColor>What would you like to do?</Text>
</Box>
<Box flexDirection="column">
<Select options={options} onChange={handleSelect} onCancel={handleCancel} />
</Box>
<Box marginTop={1}>
<Text dimColor>
View the latest workflow template at:{' '}
<Text color="claude">https://github.com/anthropics/claude-code-action/blob/main/examples/claude.yml</Text>
</Text>
</Box>
</Box>
);
}