-
Notifications
You must be signed in to change notification settings - Fork 0
86 lines (69 loc) · 2.02 KB
/
_helmfile.yaml
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
name: Helmfile
on:
workflow_dispatch:
inputs:
sync:
description: Whether or not to sync
type: boolean
default: false
workflow_call:
inputs:
sync:
description: Whether or not to sync
type: boolean
default: false
jobs:
helmfile:
runs-on: [self-hosted]
permissions:
pull-requests: write
id-token: write
defaults:
run:
working-directory: wheatley
steps:
- uses: actions/checkout@v3
- id: lint
run: |
set -o pipefail
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
echo "stdout<<$EOF" >> $GITHUB_OUTPUT
helmfile lint | tee -a $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- id: diff
run: |
set -o pipefail
EOF=$(dd if=/dev/urandom bs=15 count=1 status=none | base64)
helmfile diff | tee -a $GITHUB_OUTPUT
echo "$EOF" >> $GITHUB_OUTPUT
- if: github.event_name == 'pull_request'
uses: actions/github-script@v6
env:
lint_stdout: ${{ steps.lint.outputs.stdout }}
diff_stdout: ${{ steps.diff.outputs.stdout }}
with:
script: |
const output = `
<details><summary>Lint Output</summary>
\`\`\`\n
${process.env.lint_stdout.trim()}
\`\`\`
</details>
<details><summary>Diff Output</summary>
\`\`\`\n
${process.env.diff_stdout.trim()}
\`\`\`
</details>
*${[
"Pusher: @${{ github.actor }}",
"Action: `${{ github.event_name }}`",
].join(", ")}*
`.trim();
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: output
});
- if: inputs.sync == true || inputs.sync == 'true'
run: helmfile sync