Update cnquery and provider dependencies #18
Workflow file for this run
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
name: Update cnuery and provider dependencies | |
on: | |
schedule: | |
- cron: "11 8 * * 1" # every monday | |
workflow_dispatch: | |
jobs: | |
update-deps: | |
runs-on: ubuntu-latest | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
ssh-key: ${{ secrets.CNQUERY_DEPLOY_KEY_PRIV }} | |
- name: Import environment variables from file | |
run: cat ".github/env" >> $GITHUB_ENV | |
- name: Install Go | |
uses: actions/setup-go@v5 | |
with: | |
go-version: ">=${{ env.golang-version }}" | |
cache: false | |
- name: Update deps | |
id: update-deps | |
run: | | |
shopt -s expand_aliases | |
alias version="go run providers-sdk/v1/util/version/version.go" | |
version mod-update . --latest | |
version mod-update providers/*/ --latest | |
version mod-tidy providers/*/ | |
version mod-tidy . | |
- name: Prepare title and branch name | |
id: branch | |
run: | | |
BRANCH_NAME="version/deps_update_$(date +%Y%m%d_%H%M)" | |
COMMIT_MSG="🧹 Update deps for cnquery and providers $(date +%Y%m%d)" | |
echo "COMMIT_TITLE=${COMMIT_MSG}" >> $GITHUB_OUTPUT | |
echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_OUTPUT | |
- name: Create pull request | |
id: cpr | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
draft: true | |
base: main | |
labels: dependencies,go | |
committer: "Mondoo Tools <tools@mondoo.com>" | |
commit-message: ${{ steps.branch.outputs.COMMIT_TITLE }} | |
author: "Mondoo Tools <tools@mondoo.com>" | |
title: ${{ steps.branch.outputs.COMMIT_TITLE }} | |
branch: ${{ steps.branch.outputs.BRANCH_NAME }} | |
body-path: .github/pr-body.md | |
- name: PR infos | |
if: ${{ steps.cpr.outputs.pull-request-number }} | |
run: | | |
echo "Pull Request Number - ${{ steps.cpr.outputs.pull-request-number }}" | |
echo "Pull Request URL - ${{ steps.cpr.outputs.pull-request-url }}" |