|
5 | 5 | branches: |
6 | 6 | - main |
7 | 7 | schedule: |
8 | | - - cron: '05 10 * * *' # 10:05am UTC everyday |
| 8 | + - cron: "05 10 * * *" # 10:05am UTC everyday |
9 | 9 | push: |
10 | 10 | branches: |
11 | 11 | - main |
12 | 12 | paths-ignore: |
13 | | - - '**/README.md' |
| 13 | + - "**/README.md" |
14 | 14 | workflow_dispatch: |
15 | 15 |
|
16 | 16 | env: |
17 | | - IMAGE_NAME: "${{ github.event.repository.name }}" # the name of the image produced by this build, matches repo names |
| 17 | + IMAGE_NAME: "${{ github.event.repository.name }}" # the name of the image produced by this build, matches repo names |
18 | 18 | IMAGE_DESC: "My Customized Universal Blue Image" |
19 | | - IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}" # do not edit |
20 | | - ARTIFACTHUB_LOGO_URL: "https://avatars.githubusercontent.com/u/120078124?s=200&v=4" # You should put your own image here so that you get a fancy profile image on https://artifacthub.io/! |
| 19 | + IMAGE_REGISTRY: "ghcr.io/${{ github.repository_owner }}" # do not edit |
| 20 | + ARTIFACTHUB_LOGO_URL: "https://avatars.githubusercontent.com/u/120078124?s=200&v=4" # You should put your own image here so that you get a fancy profile image on https://artifacthub.io/! |
21 | 21 |
|
22 | 22 | concurrency: |
23 | 23 | group: ${{ github.workflow }}-${{ github.ref || github.run_id }}-${{ inputs.brand_name}}-${{ inputs.stream_name }} |
|
43 | 43 | # uses: ublue-os/remove-unwanted-software@517622d6452028f266b7ba4cc9a123b5f58a6b53 # v7 |
44 | 44 | # with: |
45 | 45 | # remove-codeql: true |
46 | | - |
| 46 | + |
47 | 47 | - name: Get current date |
48 | 48 | id: date |
49 | 49 | run: | |
|
86 | 86 | sep-tags: " " |
87 | 87 | sep-annotations: " " |
88 | 88 |
|
| 89 | + - name: Install Cosign |
| 90 | + uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2 |
| 91 | + if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) |
| 92 | + |
| 93 | + # With cosign we can verify the authenticity of the upstream image. |
| 94 | + # This is highly recommended to ensure the upstream wasn't tampered with. |
| 95 | + # This can fail through a key mismatch or upstream image not being signed. |
| 96 | + # |
| 97 | + # We find the upstream image by checking the 'FROM' field. |
| 98 | + - name: Verify upstream container image |
| 99 | + if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) |
| 100 | + shell: bash |
| 101 | + run: | |
| 102 | + set -oue pipefail |
| 103 | + echo "Get upstream image tag" |
| 104 | + image=$(grep -i '^FROM.*:\S*' "./Containerfile" | awk '{print $2}') |
| 105 | + echo "Using Cosign to verify image" |
| 106 | + cosign verify \ |
| 107 | + --key https://raw.githubusercontent.com/ublue-os/main/main/cosign.pub \ |
| 108 | + "${image}" |
| 109 | +
|
89 | 110 | - name: Build Image |
90 | 111 | id: build_image |
91 | 112 | uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 # v2 |
@@ -165,9 +186,6 @@ jobs: |
165 | 186 | # your project for others to consume. You will need to create a public and private key |
166 | 187 | # using Cosign and save the private key as a repository secret in Github for this workflow |
167 | 188 | # to consume. For more details, review the image signing section of the README. |
168 | | - - name: Install Cosign |
169 | | - uses: sigstore/cosign-installer@3454372f43399081ed03b604cb2d021dabca52bb # v3.8.2 |
170 | | - if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) |
171 | 189 |
|
172 | 190 | - name: Sign container image |
173 | 191 | if: github.event_name != 'pull_request' && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) |
|
0 commit comments