Update go-containerregistry #22
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
--- | |
# Copyright The Enterprise Contract Contributors | |
# | |
# Licensed under the Apache License, Version 2.0 (the "License"); | |
# you may not use this file except in compliance with the License. | |
# You may obtain a copy of the License at | |
# | |
# http://www.apache.org/licenses/LICENSE-2.0 | |
# | |
# Unless required by applicable law or agreed to in writing, software | |
# distributed under the License is distributed on an "AS IS" BASIS, | |
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
# See the License for the specific language governing permissions and | |
# limitations under the License. | |
# | |
# SPDX-License-Identifier: Apache-2.0 | |
name: Update go-containerregistry | |
"on": | |
workflow_dispatch: | |
schedule: | |
# Mondays at 9:30 AM | |
- cron: "30 9 * * 1" | |
permissions: | |
contents: read | |
jobs: | |
update: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 | |
- uses: actions/cache/restore@1bd1e32a3bdc45362d1e726936510720a7c30a57 # v4.2.0 | |
with: | |
key: main | |
path: '**' | |
- uses: actions/setup-go@3041bf56c941b39c61721a86cd11f3bb1338122a # v5.2.0 | |
with: | |
go-version-file: go.mod | |
cache: false | |
- name: update | |
run: | | |
go mod edit -replace github.com/google/go-containerregistry=github.com/enterprise-contract/go-containerregistry@main | |
go mod tidy | |
env: | |
# Hack to ensure this repo is always updated, see: | |
# https://github.com/golang/go/issues/45413 | |
GOPRIVATE: github.com/enterprise-contract/go-containerregistry | |
- uses: actions/create-github-app-token@5d869da34e18e7287c1daad50e0b8ea0f506ce69 # v1.11.0 | |
id: generate-token | |
with: | |
app-id: ${{ vars.EC_AUTOMATION_APP_ID }} | |
private-key: ${{ secrets.EC_AUTOMATION_KEY }} | |
- name: pull-request | |
uses: peter-evans/create-pull-request@5e914681df9dc83aa4e4905692ca88beb2f9e91f # v7.0.5 | |
with: | |
add-paths: | | |
go.mod | |
go.sum | |
branch: ci/update-go-containerregistry | |
commit-message: Bump enterprise-contract/go-containerregistry | |
sign-commits: true | |
signoff: true | |
title: Bump enterprise-contract/go-containerregistry | |
# We could use secrets.GITHUB_TOKEN here. That token is generated on-demand for any | |
# workflow by GitHub. However, actions performed when using that token do not trigger | |
# other events. So if we create a pull_request, it won't trigger all the CI checks. More: | |
# https://docs.github.com/en/actions/writing-workflows/choosing-when-your-workflow-runs/triggering-a-workflow#triggering-a-workflow-from-a-workflow | |
token: ${{ steps.generate-token.outputs.token }} |