-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yaml
39 lines (39 loc) · 1.19 KB
/
action.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
---
name: 'Flux diff'
description: 'Run flux diff to see what changes would be applied to the cluster'
author: 'SPV'
inputs:
path-filter:
description: "Path to filter the flux diff"
required: true
default: "."
outputs:
diff-output:
description: "Flux diff output"
value: ${{ steps.set-output.outputs.diff-output }}
runs:
using: "composite"
steps:
- name: Setup YQ
run: |
sudo curl -sL https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -o /usr/local/bin/yq
sudo chmod +x /usr/local/bin/yq
shell: bash
- name: Setup Flux CLI
uses: fluxcd/flux2/action@main
- name: Set GitHub Path
run: echo "$GITHUB_ACTION_PATH" >> $GITHUB_PATH
shell: bash
env:
GITHUB_ACTION_PATH: ${{ github.action_path }}
- name: Run flux-diff.sh
run: PATH_FILTER=${{ inputs.path-filter }} ${{ github.action_path }}/flux-diff.sh
shell: bash
- name: Set diff output as action output
shell: bash
id: set-output
run: |
DIFF_OUTPUT=$(cat diff-output.txt)
echo "diff-output<<EOF" >> $GITHUB_OUTPUT
echo "$DIFF_OUTPUT" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT