Skip to content

Update ArtifactHUB images annotations #244

Update ArtifactHUB images annotations

Update ArtifactHUB images annotations #244

name: Update ArtifactHUB images annotations
on:
schedule:
- cron: "0 0 * * *"
workflow_dispatch: {}
jobs:
getAllCharts:
runs-on: ubuntu-22.04
outputs:
charts: ${{ steps.getCharts.outputs.charts }}
steps:
- uses: actions/checkout@v3
- name: Get all charts
id: getCharts
run: |
set -ex
set -o pipefail
(
echo -n charts=
for chart in charts/*; do
if [[ "$chart" != "charts/*" ]]; then
echo "$chart"
fi
done | cut -d / -f 2 | jq -c -Rn '[inputs]'
) | tee "$GITHUB_OUTPUT"
extractImagesForMultipleCharts:
runs-on: ubuntu-22.04
needs: getAllCharts
strategy:
matrix:
chart: ${{ fromJson(needs.getAllCharts.outputs.charts) }}
steps:
- uses: actions/checkout@v3
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
- name: extract images for ${{ matrix.chart }}
run: ./.github/scripts/extract-artifacthub-images.sh "charts/${{ matrix.chart }}"
- name: enforce trusted registries
run: ./.github/scripts/enforce-trusted-registries.sh "charts/${{ matrix.chart }}"
- name: Create PR
id: create-pr
uses: peter-evans/create-pull-request@v5
with:
add-paths: |
charts/${{ matrix.chart }}/Chart.yaml
commit-message: "chore(${{ matrix.chart }}/artifacthub-images): Update images in 'Chart.yaml'"
author: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
branch: chore/${{ matrix.chart }}-update-artifacthub-images
title: "chore(${{ matrix.chart }}/artifacthub-images): Update ArtifactHUB images"
- name: Set PR to auto-merge
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