-
Notifications
You must be signed in to change notification settings - Fork 5
56 lines (54 loc) · 2.41 KB
/
create-new.yml
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
name: Component Definitions Create
on:
workflow_dispatch:
inputs:
import_name:
required: true
description: Name of profile in trestle workspace to be imported into the component definition
output:
required: true
description: Name of the component definition to create
component_name:
required: true
description: Name of the component in the generated component definition
component_description:
required: true
description: Description of the component in the generated component definition
filter_by_profile:
required: false
description: Filter the component definition control by a separate profile
jobs:
create-component:
name: Create component definition
runs-on: ubuntu-latest
steps:
- name: Generate app token
uses: tibdex/[email protected]
id: get_installation_token
with:
app_id: ${{ secrets.APP_ID }}
private_key: ${{ secrets.PRIVATE_KEY }}
permissions: >-
{"contents": "write", "pull_requests": "write"}
- name: Clone
uses: actions/checkout@v4
with:
token: ${{ steps.get_installation_token.outputs.token }}
- name: Create new component definition
id: create-cd
uses: RedHatProductSecurity/trestle-bot/actions/[email protected]
with:
markdown_path: "markdown/components"
profile_name: ${{ github.event.inputs.import_name }}
component_definition_name: ${{ github.event.inputs.output }}
component_title: ${{ github.event.inputs.component_name }}
component_description: ${{ github.event.inputs.component_description }}
file_pattern: "*.json,rules/*,markdown/*"
branch: component-create-${{ github.run_id }}
target_branch: "main"
commit_user_name: "trestle-bot[bot]"
commit_user_email: "136850459+trestle-bot[bot]@users.noreply.github.com"
commit_message: "adds ${{ github.event.inputs.component_name }} component to ${{ github.event.inputs.output }} component definition [skip ci]"
pull_request_title: "Add ${{ github.event.inputs.component_name }} component to ${{ github.event.inputs.output }} component definition"
github_token: ${{ steps.get_installation_token.outputs.token }}
filter_by_profile: ${{ github.event.inputs.filter_by_profile }}