Skip to content
New issue

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

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

Already on GitHub? # to your account

Improve secrets tab #574

Merged
merged 1 commit into from
Dec 8, 2021
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 web/src/components/form/CheckboxesField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
:key="option.value"
:model-value="innerValue.includes(option.value)"
:label="option.text"
:description="option.description"
class="mb-2"
@update:model-value="clickOption(option)"
/>
Expand Down
20 changes: 20 additions & 0 deletions web/src/components/form/TextField.vue
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"
>
<input
v-if="lines === 1"
v-model="innerValue"
class="
w-full
Expand All @@ -24,6 +25,20 @@
:type="type"
:placeholder="placeholder"
/>
<textarea
v-else
v-model="innerValue"
class="
w-full
bg-transparent
text-gray-600
placeholder-gray-400
focus:outline-none focus:border-blue-400
dark:placeholder-gray-600 dark:text-gray-500
"
:placeholder="placeholder"
:rows="lines"
/>
</div>
</template>

Expand All @@ -50,6 +65,11 @@ export default defineComponent({
type: String,
default: 'text',
},

lines: {
type: Number,
default: 1,
},
},

emits: {
Expand Down
9 changes: 7 additions & 2 deletions web/src/components/repo/settings/SecretsTab.vue
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@
</InputField>

<InputField label="Value">
<TextField v-model="selectedSecret.value" placeholder="Value" required />
<TextField v-model="selectedSecret.value" placeholder="Value" :lines="5" required />
</InputField>

<InputField label="Available at following events">
Expand Down Expand Up @@ -87,7 +87,12 @@ const emptySecret = {
const secretEventsOptions: CheckboxOption[] = [
{ value: WebhookEvents.Push, text: 'Push' },
{ value: WebhookEvents.Tag, text: 'Tag' },
{ value: WebhookEvents.PullRequest, text: 'Pull Request' },
{
value: WebhookEvents.PullRequest,
text: 'Pull Request',
description:
'Please be careful with this option as a bad actor can submit a malicious pull request that exposes your secrets.',
},
{ value: WebhookEvents.Deploy, text: 'Deploy' },
];

Expand Down