Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/cd-update-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
workflow_call:
workflow_dispatch:

permissions:
contents: write

jobs:
generate-charts:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -74,12 +77,13 @@ jobs:

CHARTS_SHA="$(git rev-parse HEAD)"
CHARTS_SHORT_SHA="${CHARTS_SHA:0:7}"
REPO_SLUG="${{ github.repository }}"

# Update chart URLs in README
sed -i "s|https://raw.githubusercontent.com/Bobronium/copium/[^/]*/assets/chart_|https://raw.githubusercontent.com/Bobronium/copium/${CHARTS_SHA}/assets/chart_|g" README.md
sed -i "s|https://raw.githubusercontent.com/${REPO_SLUG}/[^/]*/assets/chart_|https://raw.githubusercontent.com/${REPO_SLUG}/${CHARTS_SHA}/assets/chart_|g" README.md

# Update showcase.ipynb link to charts commit (notebook is updated with charts)
sed -i "s|https://github.com/Bobronium/copium/blob/[^/]*/showcase.ipynb|https://github.com/Bobronium/copium/blob/${CHARTS_SHA}/showcase.ipynb|g" README.md
sed -i "s|https://github.com/${REPO_SLUG}/blob/[^/]*/showcase.ipynb|https://github.com/${REPO_SLUG}/blob/${CHARTS_SHA}/showcase.ipynb|g" README.md

git add README.md

Expand Down
7 changes: 6 additions & 1 deletion .github/workflows/cd-verify-charts.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@ on:
workflow_call:
workflow_dispatch:

permissions:
contents: read

jobs:
verify-charts:
runs-on: ubuntu-latest
Expand All @@ -17,8 +20,10 @@ jobs:
run: |
set -euo pipefail

REPO_SLUG="${{ github.repository }}"

# Extract the chart commit SHA from README
CHART_SHA=$(grep -oP 'https://raw\.githubusercontent\.com/Bobronium/copium/\K[a-f0-9]{40}(?=/assets/chart_)' README.md | head -n1 || true)
CHART_SHA=$(grep -oP "https://raw\\.githubusercontent\\.com/${REPO_SLUG}/\\K[a-f0-9]{40}(?=/assets/chart_)" README.md | head -n1 || true)

if [[ -z "$CHART_SHA" ]]; then
echo "ERROR: No chart URLs found in README.md"
Expand Down
Loading