Skip to content

Commit 0eaccf1

Browse files
committed
ci: Clean up workflows
1 parent 560bda4 commit 0eaccf1

File tree

4 files changed

+26
-84
lines changed

4 files changed

+26
-84
lines changed

.github/workflows/docs-publish.yaml

-43
This file was deleted.

.github/workflows/flux-local.yaml

+14-26
Original file line numberDiff line numberDiff line change
@@ -19,23 +19,13 @@ jobs:
1919
name: Flux Local Test
2020
runs-on: ubuntu-latest
2121
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-
3022
- name: Checkout
3123
uses: actions/checkout@v4
32-
with:
33-
token: "${{ steps.app-token.outputs.token }}"
3424

3525
- name: Run flux-local test
3626
uses: docker://ghcr.io/allenporter/flux-local:v7.2.0
3727
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
3929

4030
diff:
4131
name: Flux Local Diff
@@ -50,24 +40,14 @@ jobs:
5040
max-parallel: 4
5141
fail-fast: false
5242
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-
6143
- name: Checkout Pull Request Branch
6244
uses: actions/checkout@v4
6345
with:
64-
token: "${{ steps.app-token.outputs.token }}"
6546
path: pull
6647

6748
- name: Checkout Default Branch
6849
uses: actions/checkout@v4
6950
with:
70-
token: "${{ steps.app-token.outputs.token }}"
7151
ref: "${{ github.event.repository.default_branch }}"
7252
path: default
7353

@@ -88,29 +68,37 @@ jobs:
8868
- name: Generate Diff
8969
id: diff
9070
run: |
91-
cat diff.patch;
9271
{
9372
echo 'diff<<EOF'
9473
cat diff.patch
9574
echo EOF
96-
} >> "$GITHUB_OUTPUT";
75+
} >> "${GITHUB_OUTPUT}";
9776
{
98-
echo "### Diff"
77+
echo "## Flux ${{ matrix.resources }} diff"
9978
echo '```diff'
10079
cat diff.patch
10180
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 }}
10390

10491
- if: ${{ steps.diff.outputs.diff != '' }}
10592
name: Add comment
10693
uses: mshick/add-pr-comment@v2
10794
with:
10895
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 }}"
11097
message-failure: Diff was not successful
11198
message: |
11299
```diff
113100
${{ steps.diff.outputs.diff }}
101+
```
114102
115103
flux-local-success:
116104
needs:

.github/workflows/lint.yaml

-8
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,6 @@ jobs:
1919
steps:
2020
- name: Checkout
2121
uses: actions/checkout@v4
22-
with:
23-
fetch-depth: 0
2422

2523
- name: Get changed files
2624
id: changed-files
@@ -43,8 +41,6 @@ jobs:
4341
steps:
4442
- name: Checkout
4543
uses: actions/checkout@v4
46-
with:
47-
fetch-depth: 0
4844

4945
- name: Get changed files
5046
id: changed-files
@@ -72,8 +68,6 @@ jobs:
7268
steps:
7369
- name: Checkout
7470
uses: actions/checkout@v4
75-
with:
76-
fetch-depth: 0
7771

7872
- name: Get changed files
7973
id: changed-files
@@ -95,8 +89,6 @@ jobs:
9589
steps:
9690
- name: Checkout
9791
uses: actions/checkout@v4
98-
with:
99-
fetch-depth: 0
10092

10193
- name: Get changed files
10294
id: changed-files

.github/workflows/pre-pull-images.yaml

+12-7
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,6 @@ jobs:
3030
outputs:
3131
default: ${{ steps.extract-images.outputs.default }}
3232
pull: ${{ steps.extract-images.outputs.pull }}
33-
matrix: ""
3433
steps:
3534
- name: Generate Token
3635
uses: actions/create-github-app-token@v1
@@ -54,18 +53,17 @@ jobs:
5453
--all-namespaces
5554
--path /github/workspace/kubernetes/flux/cluster
5655
--enable-images
57-
--output yaml
58-
--output-file images.yaml
56+
--only-images
57+
--output json
58+
--output-file images.json
5959
6060
- name: Extract Images
6161
id: extract-images
6262
run: |
63-
images=$(yq --indent=0 --output-format=json \
64-
'[.. | .images? | select(. != null)] | flatten | sort | unique' images.yaml \
65-
)
66-
echo "${{ matrix.branches }}=${images}" >> "$GITHUB_OUTPUT"
63+
echo "${{ matrix.branches }}=$(jq --compact-output '.' images.json)" >> "${GITHUB_OUTPUT}"
6764
6865
compare-images:
66+
if: ${{ needs.extract-images.outputs.default != needs.extract-images.outputs.pull }}
6967
name: Compare Images
7068
runs-on: ubuntu-latest
7169
needs:
@@ -83,6 +81,13 @@ jobs:
8381
)
8482
echo "images=${images}" >> "${GITHUB_OUTPUT}"
8583
84+
{
85+
echo "## New images to Pull"
86+
echo '```json'
87+
echo "${images}" | jq
88+
echo '```'
89+
} >> "${GITHUB_STEP_SUMMARY}"
90+
8691
pre-pull-images:
8792
if: ${{ needs.compare-images.outputs.images != '[]' }}
8893
name: Pre-pull Images

0 commit comments

Comments
 (0)