Skip to content

Update ArtifactHUB images annotations #701

Update ArtifactHUB images annotations

Update ArtifactHUB images annotations #701

name: Update ArtifactHUB images annotations
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch: {}
jobs:
getAllCharts:
runs-on: ubuntu-latest
outputs:
charts: ${{ steps.getCharts.outputs.charts }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
- name: Get all charts
id: getCharts
run: |
set -ex
set -o pipefail
(
echo -n charts=
for chart in charts/*; do
if [[ "$chart" != "charts/*" && -f "$chart/ci/artifacthub-values.yaml" ]]; then
echo "$chart"
fi
done | cut -d / -f 2 | jq -c -Rn '[inputs]'
) | tee -a "$GITHUB_OUTPUT"
extractImagesForMultipleCharts:
runs-on: ubuntu-latest
needs: getAllCharts
strategy:
matrix:
chart: ${{ fromJson(needs.getAllCharts.outputs.charts) }}
steps:
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4
with:
token: ${{ secrets.ACTIONS_BOT_TOKEN }}
- run: pip install yq
- name: Install sponge
run: sudo apt-get -yq install moreutils
- run: ./.github/scripts/prepare-values.sh "charts/${{ matrix.chart }}"
- run: ./.github/scripts/extract-artifacthub-images.sh "charts/${{ matrix.chart }}"
- run: ./.github/scripts/enforce-trusted-registries.sh "charts/${{ matrix.chart }}"
- id: create-pr
uses: peter-evans/create-pull-request@c5a7806660adbe173f04e3e038b0ccdcd758773c # v6
with:
add-paths: |
charts/${{ matrix.chart }}/Chart.yaml
commit-message: "ci(${{ matrix.chart }}/artifacthub-images): Update images in 'Chart.yaml'"
branch: ci/${{ matrix.chart }}/update-artifacthub-images
title: "ci(${{ matrix.chart }}/artifacthub-images): Update ArtifactHUB images"
body: |
Updates the ArtifactHUB images to the really deployed ones.
- if: ${{ steps.create-pr.outputs.pull-request-number }}
run: gh pr merge --auto --squash "$PR_NUMBER"
env:
GH_TOKEN: ${{ secrets.ACTIONS_BOT_TOKEN }}
PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }}
merge-method: squash
- if: ${{ steps.create-pr.outputs.pull-request-number }}
uses: juliangruber/approve-pull-request-action@b71c44ff142895ba07fad34389f1938a4e8ee7b0 # v2.0.6
with:
github-token: ${{ secrets.ACTIONS_BOT_TOKEN }}
number: ${{ steps.create-pr.outputs.pull-request-number }}
merge-method: squash