|
| 1 | +# Copyright 2022 Google LLC |
| 2 | +# |
| 3 | +# Licensed under the Apache License, Version 2.0 (the "License"); |
| 4 | +# you may not use this file except in compliance with the License. |
| 5 | +# You may obtain a copy of the License at |
| 6 | +# |
| 7 | +# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 | +# |
| 9 | +# Unless required by applicable law or agreed to in writing, software |
| 10 | +# distributed under the License is distributed on an "AS IS" BASIS, |
| 11 | +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 12 | +# See the License for the specific language governing permissions and |
| 13 | +# limitations under the License. |
| 14 | + |
| 15 | +name: 'Update Checksums File' |
| 16 | +on: |
| 17 | + workflow_dispatch: |
| 18 | + schedule: |
| 19 | + - cron: '0 0 */1 * *' |
| 20 | + |
| 21 | +jobs: |
| 22 | + update-checksums: |
| 23 | + permissions: |
| 24 | + contents: 'write' |
| 25 | + packages: 'write' |
| 26 | + runs-on: 'ubuntu-latest' |
| 27 | + steps: |
| 28 | + - id: 'checkout' |
| 29 | + uses: 'actions/checkout@93ea575cb5d8a053eaa0ac8fa3b40d7e05a33cc8' # ratchet:actions/checkout@v3 |
| 30 | + # Generate updates to the checksum file if there are new released versions of terraform |
| 31 | + - id: 'generate-updates' |
| 32 | + run: './.github/generate_version_checksums.sh;' |
| 33 | + # Create a pull request for review |
| 34 | + - id: 'create-pull-request' |
| 35 | + if: ${{ env.CHANGES }} |
| 36 | + uses: peter-evans/create-pull-request@b4d51739f96fca8047ad065eccef63442d8e99f7 # ratchet:peter-evans/create-pull-request@v4 |
| 37 | + with: |
| 38 | + add-paths: 'terraform-checksums.json' |
| 39 | + commit-message: 'chore: [automated] checksum updates' |
| 40 | + delete-branch: true |
| 41 | + branch: '${{ env.PR_BRANCH }}' |
| 42 | + title: 'chore: Terraform checksum updates for ${{ env.UPDATE_DATE }}' |
| 43 | + body: |- |
| 44 | + Adds Terraform binary checksums for ${{ env.CHANGES }} versions: ${{ env.VERSIONS }} |
0 commit comments