-
Notifications
You must be signed in to change notification settings - Fork 2
Fix skaffold Flux OCI push repository value under YAML folding #402
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -48,6 +48,12 @@ in | |
| description = "Overrides for skaffold integration"; | ||
| }; | ||
|
|
||
| flux-push = mkOption { | ||
| type = types.submodule { freeformType = yamlFormat.type; }; | ||
| default = { }; | ||
| description = "Overrides for the Flux OCI push of rendered manifests (repository is derived automatically)"; | ||
| }; | ||
|
|
||
| otel-endpoint = mkOption { | ||
| type = types.str; | ||
| default = ""; | ||
|
|
@@ -147,6 +153,17 @@ in | |
| // cfg.settings.checkout; | ||
| } | ||
| { | ||
| id = "repo"; | ||
| shell = "bash"; | ||
| run = '' | ||
| owner=''${GITHUB_REPOSITORY%%/*} | ||
| name=''${GITHUB_REPOSITORY##*/} | ||
| echo "owner=$owner" >> "$GITHUB_OUTPUT" | ||
| echo "name=$name" >> "$GITHUB_OUTPUT" | ||
| echo "repository=ghcr.io/$owner/$name/manifests/$name" >> "$GITHUB_OUTPUT" | ||
| ''; | ||
| } | ||
| { | ||
| uses = "docker/login-action@v4"; | ||
| "with" = { | ||
| registry = "ghcr.io"; | ||
|
|
@@ -197,6 +214,16 @@ in | |
| path = "artifacts/skaffold-manifest.yaml"; | ||
| }; | ||
| } | ||
| { | ||
| id = "flux-push"; | ||
| "if" = "\${{ inputs.push }}"; | ||
| uses = "shikanime-labs/actions/flux/flux-push@v9"; | ||
| "with" = { | ||
| path = "artifacts/skaffold-manifest.yaml"; | ||
| repository = "\${{ steps.repo.outputs.repository }}"; | ||
| } | ||
| // cfg.settings.flux-push; | ||
| } | ||
| ]; | ||
| }; | ||
|
|
||
|
|
@@ -233,6 +260,19 @@ in | |
| // cfg.settings.checkout; | ||
| } | ||
| { | ||
| id = "repo"; | ||
| shell = "bash"; | ||
| env.matrix_name = "\${{ matrix.name }}"; | ||
| run = '' | ||
| owner=''${GITHUB_REPOSITORY%%/*} | ||
| name=''${GITHUB_REPOSITORY##*/} | ||
| echo "owner=$owner" >> "$GITHUB_OUTPUT" | ||
| echo "name=$name" >> "$GITHUB_OUTPUT" | ||
| manifest_repo=''${matrix_name:-$name} | ||
| echo "repository=ghcr.io/$owner/$name/manifests/$manifest_repo" >> "$GITHUB_OUTPUT" | ||
| ''; | ||
| } | ||
| { | ||
| uses = "docker/login-action@v4"; | ||
| "with" = { | ||
| registry = "ghcr.io"; | ||
|
|
@@ -263,6 +303,27 @@ in | |
| } | ||
| // optionalAttrs (cfg.settings.integration != { }) cfg.settings.integration; | ||
| } | ||
| { | ||
| name = "Save manifest"; | ||
| env.SKAFFOLD_MANIFEST = "\${{ steps.skaffold.outputs.manifest }}"; | ||
| run = '' | ||
| mkdir -p artifacts | ||
| cat > artifacts/skaffold-manifest.yaml <<'MANIFEST_EOF' | ||
| $SKAFFOLD_MANIFEST | ||
|
Comment on lines
+311
to
+312
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win 🔎 Supported by static analysis🏁 Script executed: #!/bin/bash
set -eu
printf '%s\n' '--- applicable repository conventions and learnings ---'
find /tmp/coderabbit-repo-knowledge/shikanime-labs-devlib-38900a58 \
-maxdepth 2 -type f -name '*.md' -print | sort
for f in /tmp/coderabbit-repo-knowledge/shikanime-labs-devlib-38900a58/*/*.md; do
case "$f" in
*learnings*/*|*architecture*/*|*conventions*/*|*guidelines*/*)
printf '%s\n' "--- $f"
head -80 "$f"
;;
esac
done
printf '%s\n' '--- target file around the changed hunk ---'
cat -n modules/devenv/integrations/github/skaffold.nix | sed -n '240,335p'
printf '%s\n' '--- directly bound manifest and workflow references ---'
rg -n -C 4 \
'SKAFFOLD_MANIFEST|skaffold\.outputs\.manifest|skaffold-manifest\.yaml|repoStep|flux-push|profile' \
modules/devenv/integrations/github/skaffold.nixRepository: shikanime-labs/devlib Length of output: 24018 Write the rendered manifest contents. The quoted here-document writes the literal 🤖 Prompt for AI Agents |
||
| MANIFEST_EOF | ||
| ''; | ||
| shell = "bash"; | ||
| } | ||
| { | ||
| id = "flux-push"; | ||
| "if" = "\${{ inputs.push }}"; | ||
| uses = "shikanime-labs/actions/flux/flux-push@v9"; | ||
| "with" = { | ||
| path = "artifacts/skaffold-manifest.yaml"; | ||
| repository = "\${{ steps.repo.outputs.repository }}"; | ||
| } | ||
| // cfg.settings.flux-push; | ||
| } | ||
| ]; | ||
| }; | ||
| }; | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.