|
1 | 1 | ---
|
2 | 2 | # The aim of this GitHub workflow is to update the params.env and commit.env files
|
3 | 3 | # 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 |
5 | 5 | on: # yamllint disable-line rule:truthy
|
6 | 6 | workflow_dispatch:
|
7 | 7 | inputs:
|
@@ -54,42 +54,60 @@ jobs:
|
54 | 54 | ref: ${{ env.TMP_BRANCH }}
|
55 | 55 | fetch-depth: 0
|
56 | 56 |
|
57 |
| - - name: Invoke script to handle the updates |
| 57 | + - name: Invoke ci/sha-digest-updater.sh script to handle the updates |
58 | 58 | shell: bash
|
59 | 59 | 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 }}" |
61 | 61 |
|
62 | 62 | - name: Commit Changes
|
63 | 63 | run: |
|
64 | 64 |
|
65 | 65 | if [[ $(git status --porcelain | wc -l) -gt 0 ]]; then
|
66 | 66 | git fetch origin ${{ env.TMP_BRANCH }} && \
|
67 | 67 | 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" && \ |
72 | 70 | git push origin ${{ env.TMP_BRANCH }}
|
73 | 71 | else
|
74 | 72 | echo "There were no changes detected in the images for the ${{ env.BRANCH_NAME }}"
|
75 | 73 | fi
|
76 | 74 |
|
| 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 | +
|
77 | 87 | - name: pull-request
|
78 | 88 | 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 | +
|
79 | 100 | 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" \ |
82 | 103 | --head $REPO_ORG:${{ env.TMP_BRANCH }} \
|
83 | 104 | --base ${{ env.BRANCH_NAME }}
|
84 | 105 | env:
|
85 | 106 | 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: | |
88 | 109 | :rocket: This is an automated Pull Request.
|
89 | 110 | Created by `/.github/workflows/notebooks-digest-updater.yaml`
|
90 |
| -
|
91 |
| - This PR updates the following files: |
92 | 111 | - `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. |
93 | 113 | - `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 |
|
0 commit comments