Skip to content

Commit

Permalink
chore(github): update workflows for the 500x time this week
Browse files Browse the repository at this point in the history
  • Loading branch information
buroa committed Dec 25, 2023
1 parent daaaf78 commit 3b35412
Show file tree
Hide file tree
Showing 9 changed files with 161 additions and 239 deletions.
97 changes: 0 additions & 97 deletions .github/scripts/extract-images.mjs

This file was deleted.

39 changes: 26 additions & 13 deletions .github/workflows/flux-diff.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ name: Flux Diff
on:
pull_request:
branches: ["master"]
paths: ["kubernetes/**.yaml"]
paths: ["kubernetes/**"]

concurrency:
group: ${{ github.workflow }}-${{ github.event.number || github.ref }}
Expand All @@ -18,25 +18,27 @@ jobs:
pull-requests: write
strategy:
matrix:
path: ["kubernetes"]
paths: ["kubernetes"]
resources: ["helmrelease", "kustomization"]
max-parallel: 4
fail-fast: false
steps:
- name: Generate Token
uses: actions/create-github-app-token@2986852ad836768dfea7781f31828eb3e17990fa # v1.6.2
uses: actions/create-github-app-token@v1
id: app-token
with:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"

- name: Checkout Live Branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Checkout Default Branch
uses: actions/checkout@v4
with:
token: "${{ steps.app-token.outputs.token }}"
ref: master
ref: "${{ github.event.repository.default_branch }}"
path: default

- name: Checkout PR branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Checkout Pull Request Branch
uses: actions/checkout@v4
with:
token: "${{ steps.app-token.outputs.token }}"
path: pull
Expand All @@ -48,8 +50,8 @@ jobs:
--log-level DEBUG
diff ${{ matrix.resources }}
--unified 6
--path-orig /github/workspace/default/${{ matrix.path }}
--path /github/workspace/pull/${{ matrix.path }}
--path-orig /github/workspace/default/${{ matrix.paths }}
--path /github/workspace/pull/${{ matrix.paths }}
--strip-attrs "helm.sh/chart,checksum/config,app.kubernetes.io/version,chart"
--limit-bytes 10000
--all-namespaces
Expand All @@ -65,13 +67,24 @@ jobs:
echo "EOF" >> $GITHUB_OUTPUT
- if: ${{ steps.diff.outputs.diff != '' }}
name: Add comment
uses: mshick/add-pr-comment@7c0890544fb33b0bdd2e59467fbacb62e028a096 # v2.8.1
name: Add Comment
uses: mshick/add-pr-comment@v2.8.1
with:
repo-token: "${{ steps.app-token.outputs.token }}"
message-id: "${{ github.event.pull_request.number }}/${{ matrix.path }}/${{ matrix.resources }}"
message-id: "${{ github.event.pull_request.number }}/${{ matrix.paths }}/${{ matrix.resources }}"
message-failure: Diff was not successful
message: |
```diff
${{ steps.diff.outputs.diff }}
```
# Summarize matrix https://github.community/t/status-check-for-a-matrix-jobs/127354/7
flux-diff-success:
if: ${{ always() }}
needs: ["flux-diff"]
name: Flux Diff Successful
runs-on: ubuntu-latest
steps:
- if: ${{ contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') }}
name: Check matrix status
run: exit 1
120 changes: 0 additions & 120 deletions .github/workflows/flux-hr-image-test.yaml

This file was deleted.

6 changes: 5 additions & 1 deletion .github/workflows/flux-hr-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ jobs:
app-id: "${{ secrets.BOT_APP_ID }}"
private-key: "${{ secrets.BOT_APP_PRIVATE_KEY }}"

- name: Checkout
- name: Checkout Default Branch
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
token: "${{ steps.app-token.outputs.token }}"
Expand Down Expand Up @@ -61,6 +61,10 @@ jobs:
files: kubernetes/**/helmrelease.yaml
safe_output: false

- if: ${{ github.event.inputs.helmRepoNamespace == '' && github.event.inputs.helmRepoName == '' }}
name: List All Changed Files
run: echo "${{ steps.changed-files.outputs.all_changed_and_modified_files }}"

- if: ${{ github.event.inputs.helmRepoNamespace == '' && github.event.inputs.helmRepoName == '' }}
name: Sync HelmRepository
env:
Expand Down
Loading

0 comments on commit 3b35412

Please sign in to comment.