Skip to content

Update go-containerregistry #33

Update go-containerregistry

Update go-containerregistry #33

---
# 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@d4323d4df104b026a6aa633fdb11d772146be0bf # v4.2.2
with:
key: main
path: '**'
- uses: actions/setup-go@f111f3307d8850f501ac008e886eec1fd1932a34 # v5.3.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@21cfef2b496dd8ef5b904c159339626a10ad380e # v1.11.6
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@dd2324fc52d5d43c699a5636bcf19fceaa70c284 # v7.0.7
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 }}