Update ArtifactHUB images annotations #711
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7 | |
with: | |
token: ${{ secrets.ACTIONS_BOT_TOKEN }} # otherwise downstream workflows are not being run | |
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 }} | |
merge-method: squash | |
- if: ${{ steps.create-pr.outputs.pull-request-number }} | |
run: gh pr review --approve "$PR_NUMBER" | |
env: | |
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PR_NUMBER: ${{ steps.create-pr.outputs.pull-request-number }} |