Files
node-problem-detector/.github/workflows/update-deps.yml
dependabot[bot] 9694ee4354 Bump the actions-all group with 9 updates
Bumps the actions-all group with 9 updates:

| Package | From | To |
| --- | --- | --- |
| [step-security/harden-runner](https://github.com/step-security/harden-runner) | `2.7.1` | `2.10.1` |
| [actions/checkout](https://github.com/actions/checkout) | `3.6.0` | `4.1.7` |
| [github/codeql-action](https://github.com/github/codeql-action) | `2.25.5` | `3.26.7` |
| [actions/dependency-review-action](https://github.com/actions/dependency-review-action) | `2.5.1` | `4.3.4` |
| [ossf/scorecard-action](https://github.com/ossf/scorecard-action) | `2.0.6` | `2.4.0` |
| [actions/upload-artifact](https://github.com/actions/upload-artifact) | `3.1.3` | `4.4.0` |
| [actions/setup-go](https://github.com/actions/setup-go) | `5.0.1` | `5.0.2` |
| [peter-evans/create-pull-request](https://github.com/peter-evans/create-pull-request) | `6` | `7` |
| [jacobtomlinson/gha-find-replace](https://github.com/jacobtomlinson/gha-find-replace) | `2` | `3` |


Updates `step-security/harden-runner` from 2.7.1 to 2.10.1
- [Release notes](https://github.com/step-security/harden-runner/releases)
- [Commits](a4aa98b93c...91182cccc0)

Updates `actions/checkout` from 3.6.0 to 4.1.7
- [Release notes](https://github.com/actions/checkout/releases)
- [Commits](https://github.com/actions/checkout/compare/v3.6.0...v4.1.7)

Updates `github/codeql-action` from 2.25.5 to 3.26.7
- [Release notes](https://github.com/github/codeql-action/releases)
- [Changelog](https://github.com/github/codeql-action/blob/main/CHANGELOG.md)
- [Commits](d05fceb045...8214744c54)

Updates `actions/dependency-review-action` from 2.5.1 to 4.3.4
- [Release notes](https://github.com/actions/dependency-review-action/releases)
- [Commits](0efb1d1d84...5a2ce3f5b9)

Updates `ossf/scorecard-action` from 2.0.6 to 2.4.0
- [Release notes](https://github.com/ossf/scorecard-action/releases)
- [Changelog](https://github.com/ossf/scorecard-action/blob/main/RELEASE.md)
- [Commits](99c53751e0...62b2cac7ed)

Updates `actions/upload-artifact` from 3.1.3 to 4.4.0
- [Release notes](https://github.com/actions/upload-artifact/releases)
- [Commits](a8a3f3ad30...50769540e7)

Updates `actions/setup-go` from 5.0.1 to 5.0.2
- [Release notes](https://github.com/actions/setup-go/releases)
- [Commits](cdcb360436...0a12ed9d6a)

Updates `peter-evans/create-pull-request` from 6 to 7
- [Release notes](https://github.com/peter-evans/create-pull-request/releases)
- [Commits](https://github.com/peter-evans/create-pull-request/compare/v6...v7)

Updates `jacobtomlinson/gha-find-replace` from 2 to 3
- [Release notes](https://github.com/jacobtomlinson/gha-find-replace/releases)
- [Commits](https://github.com/jacobtomlinson/gha-find-replace/compare/v2...v3)

---
updated-dependencies:
- dependency-name: step-security/harden-runner
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-all
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions-all
- dependency-name: github/codeql-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions-all
- dependency-name: actions/dependency-review-action
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions-all
- dependency-name: ossf/scorecard-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
  dependency-group: actions-all
- dependency-name: actions/upload-artifact
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions-all
- dependency-name: actions/setup-go
  dependency-type: direct:production
  update-type: version-update:semver-patch
  dependency-group: actions-all
- dependency-name: peter-evans/create-pull-request
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions-all
- dependency-name: jacobtomlinson/gha-find-replace
  dependency-type: direct:production
  update-type: version-update:semver-major
  dependency-group: actions-all
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-09-18 17:02:05 +00:00

106 lines
3.8 KiB
YAML

name: 'Update Dependencies'
on:
workflow_dispatch:
schedule:
- cron: '0 20 * * 4'
env:
GOPROXY: https://proxy.golang.org
permissions:
contents: write
pull-requests: write
jobs:
update-deps:
if: ${{ github.repository == 'kubernetes/node-problem-detector' }}
runs-on: ubuntu-22.04
steps:
- name: Harden Runner
uses: step-security/harden-runner@91182cccc01eb5e619899d80e4e971d6181294a7 # v2.10.1
with:
egress-policy: audit
- uses: actions/setup-go@0a12ed9d6a96ab950c8f026ed9f722fe0da7ef32 # v5.0.2
with:
go-version: '1.22.3'
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
- name: Update Dependencies
id: update_deps
run: |
make depup
echo 'changes<<EOF' >> $GITHUB_OUTPUT
git status --porcelain >> $GITHUB_OUTPUT
echo 'EOF' >> $GITHUB_OUTPUT
- name: Create PR
if: ${{ steps.update_deps.outputs.changes != '' }}
uses: peter-evans/create-pull-request@2f38cd26bfebe301a5ee90bdd6550a69dc3ef23f # v7.0.4
with:
title: 'Update dependencies'
commit-message: Update dependencies
committer: github-actions <actions@github.com>
author: github-actions <actions@github.com>
branch: dependencies/update
branch-suffix: timestamp
base: master
delete-branch: true
labels: ok-to-test
body: |
Updating go.mod with latest dependencies...
update-go-version:
runs-on: ubuntu-22.04
steps:
- name: Checkout code
uses: actions/checkout@v4.1.7
- name: Get current Go version from Dockerfile
id: current-go-version
run: |
# Read the Dockerfile content
DOCKERFILE_CONTENT=$(cat Dockerfile)
# Extract the current Go version using regex
CURRENT_GO_VERSION=$(echo "$DOCKERFILE_CONTENT" | grep -oP 'FROM golang:\K\d+\.\d+(\.\d+)?')
echo "current_go_version=${CURRENT_GO_VERSION}" >> $GITHUB_OUTPUT
- name: Get latest Go version
id: go-version
run: |
# Fetch the Go download page and extract the latest version
LATEST_GO_VERSION=$(curl -s https://go.dev/dl/ | grep -oP 'go1\.22\.\d+' | sort -rV | head -n 1)
echo "latest_go_version=${LATEST_GO_VERSION}" >> $GITHUB_OUTPUT
- name: Update Go version
uses: jacobtomlinson/gha-find-replace@v3
with:
find: "FROM golang:${{ steps.current-go-version.outputs.current_go_version }}-bookworm as builder-base"
replace: "FROM golang:${{ steps.go-version.outputs.latest_go_version }}-bookworm as builder-base"
path: "Dockerfile"
- name: Check if Go version was updated
id: check-changes
run: |
if [[ ${{ steps.current-go-version.outputs.current_go_version }} != ${{ steps.go-version.outputs.latest_go_version }} ]]; then
echo "changes=true" >> $GITHUB_OUTPUT
else
echo "changes=false" >> $GITHUB_OUTPUT
fi
- name: Create Pull Request
if: ${{ steps.check-changes.outputs.changes == 'true' }} # Only create PR if there were changes
uses: peter-evans/create-pull-request@v7
with:
title: 'Update Go version in Dockerfile'
commit-message: 'Update Go version in Dockerfile'
committer: github-actions <actions@github.com>
author: github-actions <actions@github.com>
branch: go-version-update # Choose a suitable branch name
branch-suffix: timestamp
base: master
delete-branch: true
labels: ok-to-test
body: |
This PR updates the Go version in the Dockerfile to ${{ steps.go-version.outputs.latest_go_version }}.