Skip to content

Commit

Permalink
Align files (#206)
Browse files Browse the repository at this point in the history
Co-authored-by: github-actions <[email protected]>
  • Loading branch information
architectbot and actions-user authored May 21, 2024
1 parent 42bca9c commit 604b290
Show file tree
Hide file tree
Showing 13 changed files with 315 additions and 24 deletions.
6 changes: 3 additions & 3 deletions .github/workflows/zz_generated.add-team-labels.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ jobs:
-O artifacts/users.yaml \
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: users
path: artifacts/users.yaml
Expand All @@ -27,7 +27,7 @@ jobs:
runs-on: ubuntu-latest
needs: build_user_list
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
id: download-users
with:
name: users
Expand All @@ -46,7 +46,7 @@ jobs:
echo "EOF" >> $GITHUB_ENV
- name: Apply label to issue
if: ${{ env.LABEL != '' && env.LABEL != 'null' && env.LABEL != null }}
uses: actions-ecosystem/action-add-labels@v1
uses: actions-ecosystem/action-add-labels@bd52874380e3909a1ac983768df6976535ece7f8 # v1.1.3
with:
github_token: ${{ secrets.ISSUE_AUTOMATION }}
labels: |
Expand Down
12 changes: 6 additions & 6 deletions .github/workflows/zz_generated.add-to-project-board.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ jobs:
-O artifacts/users.yaml \
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/user-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: users
path: artifacts/users.yaml
Expand All @@ -30,7 +30,7 @@ jobs:
-O artifacts/labels.yaml \
https://raw.githubusercontent.com/giantswarm/github/main/tools/issue-automation/label-mapping.yaml
- name: Upload Artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@65462800fd760344b1a7b4382951275a0abb4808 # v4.3.3
with:
name: labels
path: artifacts/labels.yaml
Expand All @@ -42,7 +42,7 @@ jobs:
needs: build_user_list
if: github.event.action == 'assigned'
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
id: download-users
with:
name: users
Expand All @@ -57,7 +57,7 @@ jobs:
echo "BOARD=${BOARD}" >> $GITHUB_ENV
- name: Add issue to personal board
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
uses: actions/add-to-project@main
uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1
with:
project-url: ${{ env.BOARD }}
github-token: ${{ secrets.ISSUE_AUTOMATION }}
Expand All @@ -68,7 +68,7 @@ jobs:
needs: build_user_list
if: github.event.action == 'labeled'
steps:
- uses: actions/download-artifact@v4
- uses: actions/download-artifact@65a9edc5881444af0b9093a5e628f2fe47ea3b2e # v4.1.7
id: download-labels
with:
name: labels
Expand All @@ -83,7 +83,7 @@ jobs:
echo "BOARD=${BOARD}" >> $GITHUB_ENV
- name: Add issue to team board
if: ${{ env.BOARD != 'null' && env.BOARD != '' && env.BOARD != null }}
uses: actions/add-to-project@main
uses: actions/add-to-project@9bfe908f2eaa7ba10340b31e314148fcfe6a2458 # v1.0.1
with:
project-url: ${{ env.BOARD }}
github-token: ${{ secrets.ISSUE_AUTOMATION }}
4 changes: 2 additions & 2 deletions .github/workflows/zz_generated.check_values_schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/7a2bb1c2403407b720ec16e047f804471a57209e/pkg/gen/input/workflows/internal/file/check_values_schema.yaml.template
# https://github.com/giantswarm/devctl/blob/dc49303eb31fa5ef0996aadfda1da4c56a3ad883/pkg/gen/input/workflows/internal/file/check_values_schema.yaml.template
#
name: 'Values and schema'
on:
Expand All @@ -23,7 +23,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0

Expand Down
10 changes: 5 additions & 5 deletions .github/workflows/zz_generated.create_release.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/7a2bb1c2403407b720ec16e047f804471a57209e/pkg/gen/input/workflows/internal/file/create_release.yaml.template
# https://github.com/giantswarm/devctl/blob/e6dec2b0575c08766cb5c8afd1b32cf2b4c03aef/pkg/gen/input/workflows/internal/file/create_release.yaml.template
#
name: Create Release
on:
Expand Down Expand Up @@ -54,7 +54,7 @@ jobs:
echo "version=${version}" >> $GITHUB_OUTPUT
- name: Checkout code
if: ${{ steps.get_version.outputs.version != '' }}
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Get project.go path
id: get_project_go_path
if: ${{ steps.get_version.outputs.version != '' }}
Expand Down Expand Up @@ -103,7 +103,7 @@ jobs:
tarball_binary_path: "*/src/${binary}"
smoke_test: "${binary} --version"
- name: Checkout code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: Update project.go
id: update_project_go
env:
Expand Down Expand Up @@ -163,7 +163,7 @@ jobs:
upload_url: ${{ steps.create_gh_release.outputs.upload_url }}
steps:
- name: Checkout code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ github.sha }}
- name: Ensure correct version in project.go
Expand Down Expand Up @@ -216,7 +216,7 @@ jobs:
tarball_binary_path: "*/src/${binary}"
smoke_test: "${binary} --version"
- name: Check out the repository
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: 0 # Clone the whole history, not just the most recent commit.
- name: Fetch all tags and branches
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/zz_generated.create_release_pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/7a2bb1c2403407b720ec16e047f804471a57209e/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template
# https://github.com/giantswarm/devctl/blob/dc49303eb31fa5ef0996aadfda1da4c56a3ad883/pkg/gen/input/workflows/internal/file/create_release_pr.yaml.template
#
name: Create Release PR
on:
Expand Down Expand Up @@ -154,7 +154,7 @@ jobs:
binary: "architect"
version: "6.11.0"
- name: Checkout code
uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: ${{ needs.gather_facts.outputs.branch }}
- name: Prepare release changes
Expand Down
167 changes: 167 additions & 0 deletions .github/workflows/zz_generated.diff_helm_render_templates.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,167 @@
# DO NOT EDIT. Generated with:
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/dc49303eb31fa5ef0996aadfda1da4c56a3ad883/pkg/gen/input/workflows/internal/file/helm_render_diff.yaml.template
#
name: Compare Helm Rendering

on:
pull_request:
push:
branches: [HEAD_BRANCH, main]

env:
dyff_ver: "1.7.1"
helm_ver: "3.11.1"

jobs:
# This job is for checking for the `/no_diffs_printing` comment in the PR. When it is found,
# the `get-rendering-values` job is skipped, what makes `cmp-helm-rendering` skipped as well.
check-cmp-state:
runs-on: ubuntu-latest
if: github.event_name == 'pull_request'
steps:
- name: Find suspend comment
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
continue-on-error: true
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
body-regex: '^\s*/no_diffs_printing' # on a separate line, not as Markdown `<!-- /no_diffs_printing -->` comment
- name: Find suspend comment in PR body # PR body isn't a comment, so the above step won't find it
id: pr_body
run: |
if jq -r .pull_request.body "${GITHUB_EVENT_PATH}" | grep -qE '^\s*/no_diffs_printing'; then
echo "Found /no_diffs_printing command in PR body"
echo "suspend_diffs_printing_from_pr_body=true" >> $GITHUB_OUTPUT
else
echo "Did not find /no_diffs_printing command in PR body"
echo "suspend_diffs_printing_from_pr_body=false" >> $GITHUB_OUTPUT
fi
outputs:
suspend_comment_id: ${{ steps.fc.outputs.comment-id }}
suspend_diffs_printing_from_pr_body: ${{ steps.pr_body.outputs.suspend_diffs_printing_from_pr_body }}
cmp-helm-rendering:
needs: check-cmp-state
runs-on: ubuntu-latest
if: github.event_name == 'pull_request' && needs.check-cmp-state.outputs.suspend_comment_id == 0 && needs.check-cmp-state.outputs.suspend_diffs_printing_from_pr_body == 'false'
steps:
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: install helm
uses: azure/setup-helm@fe7b79cd5ee1e45176fcad797de68ecaf3ca4814 # v4.2.0
with:
version: ${{ env.helm_ver }}
- run: which helm
- name: install dyff
uses: giantswarm/install-binary-action@033b1a657eea23d9c42e77312b370e6125e4e38f # v2.0.0
with:
binary: dyff
download_url: "https://github.com/homeport/dyff/releases/download/v${version}/dyff_${version}_linux_amd64.tar.gz"
smoke_test: "${binary} version"
tarball_binary_path: "${binary}"
version: ${{ env.dyff_ver }}
- run: which dyff
- run: ls -la /opt/hostedtoolcache
- name: render helm with current code
run: |
helm repo add cluster-catalog https://giantswarm.github.io/cluster-catalog/
# We also add cluster-test-catalog so we can more easily test dev builds of subcharts.
# Charts from cluster-test-catalog should be used only for testing purposes.
helm repo add cluster-test-catalog https://giantswarm.github.io/cluster-test-catalog/
helm dependency build helm/${{ github.event.repository.name }}
for test_file_path in helm/${{ github.event.repository.name }}/ci/test-*-values.yaml; do
echo
echo "Rendering Helm template for ${test_file_path} on current code"
mkdir -p "/tmp/${test_file_path}"
helm template -n org-giantswarm -f "helm/${{ github.event.repository.name }}/ci/ci-values.yaml" -f "${test_file_path}" "helm/${{ github.event.repository.name }}" > "/tmp/${test_file_path}/render-new.yaml"
done
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
ref: "${{ github.event.repository.default_branch }}"
path: 'old'
- name: render helm with main branch code
run: |
helm dependency build old/helm/${{ github.event.repository.name }}
for test_file_path in helm/${{ github.event.repository.name }}/ci/test-*-values.yaml; do
echo
echo "Rendering Helm template for ${test_file_path} on old code"
if [ ! -d "/tmp/${test_file_path}" ]; then
echo "File ${test_file_path} does not yet exist in old code, skipping"
continue
fi
helm template -n org-giantswarm -f "old/helm/${{ github.event.repository.name }}/ci/ci-values.yaml" -f "${test_file_path}" "old/helm/${{ github.event.repository.name }}" > "/tmp/${test_file_path}/render-old.yaml"
done
- name: get the diffs
uses: mathiasvr/command-output@34408ea3d0528273faff3d9e201761ae96106cd0 # v2.0.0
with:
run: |
marker="=== No differences at all ==="
(
found_differences=
first=1
for test_file_path in helm/${{ github.event.repository.name }}/ci/test-*-values.yaml; do
if [ "${first}" = 1 ]; then
first=
else
echo
echo
fi
echo "=== Differences when rendered with values file ${test_file_path} ==="
dyff between --set-exit-code --ignore-order-changes --omit-header --use-go-patch-style "/tmp/${test_file_path}/render-old.yaml" "/tmp/${test_file_path}/render-new.yaml" && echo "No difference" || { res=$?; found_differences=1; if [[ $res -eq 255 ]]; then echo "Diff error"; fi; }
done
if [ -z "${found_differences}" ]; then
echo
echo
echo "${marker}"
fi
) > /tmp/diffs
(
if ! grep -qF "${marker}" /tmp/diffs ; then
echo "**There were differences in the rendered Helm template, please check! ⚠️**"
else
echo "There were no differences in the rendered Helm template."
fi
echo
echo "<details>"
echo "<summary>Output</summary>"
echo "<!-- mandatory empty line -->"
echo ""
echo '```'
cat /tmp/diffs
echo '```'
echo "</details>"
echo "<!-- mandatory empty line -->"
) > /tmp/comment-body
- name: Find diff comment
uses: peter-evans/find-comment@3eae4d37986fb5a8592848f6a574fdf654e61f9e # v3.1.0
continue-on-error: true
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: 'differences in the rendered Helm template'
- name: Delete old comment
uses: winterjung/comment@fda92dbcb5e7e79cccd55ecb107a8a3d7802a469 # v1.1.0
continue-on-error: true
if: steps.fc.outputs.comment-id != 0
with:
type: delete
comment_id: ${{ steps.fc.outputs.comment-id }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Create comment
uses: peter-evans/create-or-update-comment@71345be0265236311c031f5c7866368bd1eff043 # v4.0.0
with:
issue-number: ${{ github.event.pull_request.number }}
body-path: /tmp/comment-body
45 changes: 45 additions & 0 deletions .github/workflows/zz_generated.documentation_validation.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
# DO NOT EDIT. Generated with:
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/dc49303eb31fa5ef0996aadfda1da4c56a3ad883/pkg/gen/input/workflows/internal/file/cluster_app_documentation_validation.yaml.template
#

# This workflow validates the documentation generated from the JSON schema of the cluster-app
# which is located in `helm/*/values.schema.json`. Specifically, it checks whether the changes
# from `make generate-docs` were committed.

name: Documentation validation
on:
pull_request:
branches:
- master
- main
paths:
- 'helm/**/values.yaml'
- 'helm/**/values.schema.json'
- '**/*.md' # if someone manually edited a file that should contain the generated documentation

push: {}

jobs:
validate:
name: Validate documentation
runs-on: ubuntu-latest
env:
GO_VERSION: 1.21.3
steps:
- name: Set up Go ${{ env.GO_VERSION }}
uses: actions/setup-go@0c52d547c9bc32b1aa3301fd7a9cb496313a4491 # v5.0.0
with:
go-version: ${{ env.GO_VERSION }}
- name: Checkout code
uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
- name: "Run 'make generate-docs' and check for differences"
run: |
make generate-docs
if ! git diff --exit-code; then
echo "ERROR: You need to commit the changes made by \"make generate-docs\"."
exit 1
fi
4 changes: 2 additions & 2 deletions .github/workflows/zz_generated.gitleaks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
#
# devctl
#
# https://github.com/giantswarm/devctl/blob/7a2bb1c2403407b720ec16e047f804471a57209e/pkg/gen/input/workflows/internal/file/gitleaks.yaml.template
# https://github.com/giantswarm/devctl/blob/dc49303eb31fa5ef0996aadfda1da4c56a3ad883/pkg/gen/input/workflows/internal/file/gitleaks.yaml.template
#
name: gitleaks

Expand All @@ -12,7 +12,7 @@ jobs:
gitleaks:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@1d96c772d19495a3b5c517cd2bc0cb401ea0529f # v4.1.3
- uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4
with:
fetch-depth: '0'
- name: gitleaks-action
Expand Down
Loading

0 comments on commit 604b290

Please sign in to comment.