Skip to content

Commit ed90fe3

Browse files
Merge pull request #1019 from atheo89/unify-gha
Merge notebooks digest updater and runtimes updater ghas under one
2 parents cd4227c + 439d81a commit ed90fe3

6 files changed

+151
-367
lines changed

.github/workflows/notebooks-digest-updater.yaml

Lines changed: 33 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
# The aim of this GitHub workflow is to update the params.env and commit.env files
33
# This GHA works for both orgs and it checks for the tags generated from the main branch.
4-
name: Update Notebook Images and Commits With New SHAs
4+
name: Update Notebook and Runtime Images as well as the Commits With New SHAs
55
on: # yamllint disable-line rule:truthy
66
workflow_dispatch:
77
inputs:
@@ -54,42 +54,60 @@ jobs:
5454
ref: ${{ env.TMP_BRANCH }}
5555
fetch-depth: 0
5656

57-
- name: Invoke script to handle the updates
57+
- name: Invoke ci/sha-digest-updater.sh script to handle the updates
5858
shell: bash
5959
run: |
60-
bash "${GITHUB_WORKSPACE}/ci/notebooks-digest-updater.sh" "${{ env.USER_HASH }}" "${{ env.REPO_ORG }}" "${{ env.BRANCH_NAME }}" "${{ env.REPO_NAME }}"
60+
bash "${GITHUB_WORKSPACE}/ci/sha-digest-updater.sh" "${{ env.USER_HASH }}" "${{ env.REPO_ORG }}" "${{ env.BRANCH_NAME }}" "${{ env.REPO_NAME }}"
6161
6262
- name: Commit Changes
6363
run: |
6464
6565
if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then
6666
git fetch origin ${{ env.TMP_BRANCH }} && \
6767
git pull origin ${{ env.TMP_BRANCH }} && \
68-
git add "${GITHUB_WORKSPACE}/manifests/base/params.env" && \
69-
git commit -m "Update images digest hashes via ${{ env.TMP_BRANCH }} GitHub action" && \
70-
git add ""${GITHUB_WORKSPACE}/manifests/base/commit.env"" && \
71-
git commit -m "Update image commits via ${{ env.TMP_BRANCH }} GitHub action" &&\
68+
git add manifests/base/ && \
69+
git commit -m "Update image related sha digests via notebooks-digest-updater GitHub action" && \
7270
git push origin ${{ env.TMP_BRANCH }}
7371
else
7472
echo "There were no changes detected in the images for the ${{ env.BRANCH_NAME }}"
7573
fi
7674
75+
- name: Capture skipped images log (if any)
76+
id: skipped_log
77+
run: |
78+
if [[ -f ${GITHUB_WORKSPACE}/skipped-images.txt && -s ${GITHUB_WORKSPACE}/skipped-images.txt ]]; then
79+
echo "Found skipped images. Preparing message."
80+
echo 'log<<EOF' >> $GITHUB_OUTPUT
81+
cat ${GITHUB_WORKSPACE}/skipped-images.txt >> $GITHUB_OUTPUT
82+
echo 'EOF' >> $GITHUB_OUTPUT
83+
else
84+
echo "log=" >> $GITHUB_OUTPUT
85+
fi
86+
7787
- name: pull-request
7888
run: |
89+
90+
body="${PR_BODY}"
91+
92+
if [[ -n "${{ steps.skipped_log.outputs.log }}" ]]; then
93+
body+="
94+
95+
:warning: The following images were skipped during update, please push them manually or retriger the GitHub action:
96+
${{ steps.skipped_log.outputs.log }}
97+
"
98+
fi
99+
79100
gh pr create --repo https://github.com/$REPO_ORG/$REPO_NAME.git \
80-
--title "$pr_title" \
81-
--body "$pr_body" \
101+
--title "$PR_TITLE" \
102+
--body "$body" \
82103
--head $REPO_ORG:${{ env.TMP_BRANCH }} \
83104
--base ${{ env.BRANCH_NAME }}
84105
env:
85106
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
86-
pr_title: "[Notebooks Updater Action] Update Notebook Images and commit with new SHAs"
87-
pr_body: |
107+
PR_TITLE: "[Updater Action] Update Notebook and Runtime Images as well as the Commits With New SHAs"
108+
PR_BODY: |
88109
:rocket: This is an automated Pull Request.
89110
Created by `/.github/workflows/notebooks-digest-updater.yaml`
90-
91-
This PR updates the following files:
92111
- `manifests/base/params.env` file with the latest updated SHA digests of the notebooks.
112+
- `manifests/base/runtime-*.yamls` file with the latest updated SHA digests of the runtimes.
93113
- `manifests/base/commit.env` file with the latest commit.
94-
95-
:exclamation: **IMPORTANT NOTE**: Remember to delete the `${{ env.TMP_BRANCH }}` branch after merging the changes

.github/workflows/runtimes-digest-updater-v2.yaml

Lines changed: 0 additions & 87 deletions
This file was deleted.

.github/workflows/runtimes-digest-updater.yaml

Lines changed: 0 additions & 91 deletions
This file was deleted.

ci/runtimes-digest-updater-old-structure.sh

Lines changed: 0 additions & 80 deletions
This file was deleted.

0 commit comments

Comments
 (0)