Bump Cloudbeat version #46
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: Bump Cloudbeat version | |
on: | |
workflow_dispatch: | |
inputs: | |
version: | |
description: "The new version number to bump to" | |
required: true | |
jobs: | |
cloudbeat: | |
outputs: | |
stack_version: ${{ steps.extract_version.outputs.version }} | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Cloudbeat repo | |
uses: actions/checkout@v4 | |
- name: Extract current version | |
id: extract_version | |
run: | | |
version=$(grep defaultBeatVersion version/version.go | cut -f2 -d "\"") | |
echo "version=$version" >> $GITHUB_OUTPUT | |
# branch out | |
MINOR_VERSION=$(echo $version | cut -d '.' -f1,2) | |
git checkout -b $MINOR_VERSION | |
git push origin $MINOR_VERSION | |
- name: Bump cloudbeat version | |
run: | | |
git checkout main | |
sed -i'' -E "s/defaultBeatVersion = \"[0-9]+\.[0-9]+\"/defaultBeatVersion = \"${{github.event.inputs.version}}\"/g" version/version.go | |
git diff | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
with: | |
# token: ${{ secrets.FORK_TOKEN }} | |
commit-message: "Update Cloudbeat versions" | |
branch: "update_version" | |
title: "Bump Cloudbeat" | |
body: "Automated PR" | |
base: ${{ env.branch }} | |
committer: "Elastic Machine <[email protected]>" | |
author: "Elastic Machine <[email protected]>" | |
integration: | |
needs: cloudbeat | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Integrations repo | |
uses: actions/checkout@v4 | |
with: | |
token: ${{ secrets.FORK_TOKEN }} | |
repository: orouz/integrations | |
ref: main | |
- name: Update URLs | |
run: | | |
MANIFEST_PATH="packages/cloud_security_posture/manifest.yml" | |
# VERSION="${{ needs.cloudbeat.outputs.stack_version }}" | |
VERSION="5.5.5" | |
MINOR_VERSION=$(echo $VERSION | cut -d '.' -f1,2) | |
echo "MINOR_VERSION is $MINOR_VERSION" | |
PATCH_VERSION=$VERSION | |
echo "PATCH_VERSION is $PATCH_VERSION" | |
# cis_gcp | |
sed -i'' -E "s/cloudshell_git_branch=[0-9]+\.[0-9]+/cloudshell_git_branch=$MINOR_VERSION/g" $MANIFEST_PATH | |
# cis_aws + vuln_mgmt_aws | |
sed -i'' -E "s/cloudformation-cnvm-[0-9]+\.[0-9]+\.[0-9]+/cloudformation-cnvm-$PATCH_VERSION/g" $MANIFEST_PATH | |
sed -i'' -E "s/cloudformation-cspm-ACCOUNT_TYPE-[0-9]+\.[0-9]+\.[0-9]+/cloudformation-cspm-ACCOUNT_TYPE-$PATCH_VERSION/g" $MANIFEST_PATH | |
# cis_azure | |
sed -i'' -E "s/cloudbeat%2F[0-9]+\.[0-9]+/cloudbeat%2F$PATCH_VERSION/g" $MANIFEST_PATH | |
- name: Create Pull Request | |
uses: peter-evans/create-pull-request@v4 | |
id: cpr | |
with: | |
token: ${{ secrets.FORK_TOKEN }} | |
commit-message: "Update manifest template versions" | |
branch: "update-cloudbeat-integration" | |
title: "[Cloud Security] Update manifest template versions" | |
body: "Automated PR" | |
base: ${{ env.branch }} | |
committer: "Elastic Machine <[email protected]>" | |
author: "Elastic Machine <[email protected]>" |