@@ -19,23 +19,13 @@ jobs:
19
19
name : Flux Local Test
20
20
runs-on : ubuntu-latest
21
21
steps :
22
- - name : Generate Token
23
- uses : actions/create-github-app-token@v1
24
- if : ${{ github.event.pull_request.head.repo.full_name == github.repository }}
25
- id : app-token
26
- with :
27
- app-id : ${{ secrets.LAB_ASSISTANT_APP_ID }}
28
- private-key : ${{ secrets.LAB_ASSISTANT_APP_KEY }}
29
-
30
22
- name : Checkout
31
23
uses : actions/checkout@v4
32
- with :
33
- token : " ${{ steps.app-token.outputs.token }}"
34
24
35
25
- name : Run flux-local test
36
26
uses : docker://ghcr.io/allenporter/flux-local:v7.2.0
37
27
with :
38
- args : test --enable-helm --path /github/workspace/kubernetes/flux/cluster
28
+ args : test --enable-helm --all-namespaces -- path /github/workspace/kubernetes/flux/cluster -v
39
29
40
30
diff :
41
31
name : Flux Local Diff
@@ -50,24 +40,14 @@ jobs:
50
40
max-parallel : 4
51
41
fail-fast : false
52
42
steps :
53
- - name : Generate Token
54
- uses : actions/create-github-app-token@v1
55
- if : ${{ github.event.pull_request.head.repo.full_name == github.repository }}
56
- id : app-token
57
- with :
58
- app-id : ${{ secrets.LAB_ASSISTANT_APP_ID }}
59
- private-key : ${{ secrets.LAB_ASSISTANT_APP_KEY }}
60
-
61
43
- name : Checkout Pull Request Branch
62
44
uses : actions/checkout@v4
63
45
with :
64
- token : " ${{ steps.app-token.outputs.token }}"
65
46
path : pull
66
47
67
48
- name : Checkout Default Branch
68
49
uses : actions/checkout@v4
69
50
with :
70
- token : " ${{ steps.app-token.outputs.token }}"
71
51
ref : " ${{ github.event.repository.default_branch }}"
72
52
path : default
73
53
@@ -88,29 +68,37 @@ jobs:
88
68
- name : Generate Diff
89
69
id : diff
90
70
run : |
91
- cat diff.patch;
92
71
{
93
72
echo 'diff<<EOF'
94
73
cat diff.patch
95
74
echo EOF
96
- } >> "$GITHUB_OUTPUT";
75
+ } >> "${ GITHUB_OUTPUT} ";
97
76
{
98
- echo "### Diff "
77
+ echo "## Flux ${{ matrix.resources }} diff "
99
78
echo '```diff'
100
79
cat diff.patch
101
80
echo '```'
102
- } >> "$GITHUB_STEP_SUMMARY"
81
+ } >> "${GITHUB_STEP_SUMMARY}"
82
+
83
+ - name : Generate Token
84
+ uses : actions/create-github-app-token@v1
85
+ if : ${{ github.event.pull_request.head.repo.full_name == github.repository && steps.diff.outputs.diff != '' }}
86
+ id : app-token
87
+ with :
88
+ app-id : ${{ secrets.LAB_ASSISTANT_APP_ID }}
89
+ private-key : ${{ secrets.LAB_ASSISTANT_APP_KEY }}
103
90
104
91
- if : ${{ steps.diff.outputs.diff != '' }}
105
92
name : Add comment
106
93
uses : mshick/add-pr-comment@v2
107
94
with :
108
95
repo-token : " ${{ steps.app-token.outputs.token }}"
109
- message-id : " ${{ github.event.pull_request.number }}/main /${{ matrix.resources }}"
96
+ message-id : " ${{ github.event.pull_request.number }}/kubernetes /${{ matrix.resources }}"
110
97
message-failure : Diff was not successful
111
98
message : |
112
99
```diff
113
100
${{ steps.diff.outputs.diff }}
101
+ ```
114
102
115
103
flux-local-success :
116
104
needs :
0 commit comments