-
Notifications
You must be signed in to change notification settings - Fork 4
/
import.yml
90 lines (83 loc) · 3.02 KB
/
import.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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
name: Import Kusto Database
on:
workflow_dispatch:
inputs:
cluster:
description: 'Kusto Cluster'
required: true
type: choice
options:
- "myDeployment"
databases:
description: 'Kusto Databases'
required: true
extract_columns:
description: 'Include Table Columns'
type: boolean
required: false
default: false
permissions:
id-token: write
contents: write
pull-requests: write
packages: read
jobs:
extract_configuration:
runs-on: ubuntu-latest
container:
image: ghcr.io/github/KustoSchemaToolsAction:main
credentials:
username: ${{ github.actor }}
password: ${{ secrets.github_token }}
name: Import
steps:
- name: Print Parameters
run: |
echo "Cluster URI: ${{ github.event.inputs.cluster }}"
echo "Databases: ${{ github.event.inputs.databases }}"
echo "Extract Columns: ${{ github.event.inputs.extract_columns }}"
- uses: actions/checkout@v3
name: Checkout
- name: Get Current Date
id: date
run: |
echo "builddate=$(date +'%Y%m%d_%H%M%S')" >> $GITHUB_OUTPUT
- name: Setup Git
run: |
git config --global user.name "GitHub Actions"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
- name: 'Azure OIDC Login'
uses: azure/login@cb79c773a3cfa27f31f25eb3f677781210c9ce3d
with:
client-id: ${{ vars.AZURE_CLIENT_ID_OIDC }}
tenant-id: ${{ vars.AZURE_TENANT_ID_OIDC }}
allow-no-subscriptions: true
- name: Import database
uses: ./.github/actions/KustoSchemaTools
id: KustoSchemaTools
with:
mode: import
path: kusto
cluster: ${{ github.event.inputs.cluster }}
database: ${{ github.event.inputs.databases }}
extract_columns: ${{ github.event.inputs.extract_columns }}
- name: Create Pull Request
env:
CURRDATE: ${{ steps.date.outputs.builddate }}
id: cpr
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f
with:
commit-message: Extract Kusto Configuration ${{ github.event.inputs.cluster }}
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: extract/${{ github.event.inputs.cluster }}_${{ steps.date.outputs.builddate }}
delete-branch: true
title: '[Extract Configuration] ${{ github.event.inputs.cluster }} (${{ steps.date.outputs.builddate }})'
body: |
Automated cluster configuration extraction
- Cluster URI: ${{ github.event.inputs.cluster }}
- Databases: ${{ github.event.inputs.databases }}
- Extract Columns: ${{ github.event.inputs.extract_columns }}
- Date: ${{ steps.date.outputs.builddate }}
draft: false