fix: revert back recover panic test in kubernetes #493
This file contains hidden or 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: Compare Controls | ||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
branches: | ||
- main | ||
jobs: | ||
compare: | ||
runs-on: ubuntu-latest | ||
env: | ||
BENCHMARKS_PATH: "../../compliance/frameworks" | ||
CONTROLS_PATH: "../../compliance/controls" | ||
steps: | ||
- name: Checkout the repository | ||
uses: actions/checkout@v3 | ||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.22.5' | ||
- name: Run comparison script | ||
id: compare_control | ||
run: | | ||
cd .github/scripts | ||
go mod download | ||
go run . | ||
# Conditional step: Bump version and create tag only if the comparison script passes | ||
- name: Bump Version and Create Tag | ||
if: ${{ success() && steps.compare_control.outcome == 'success' }} | ||
id: versioning | ||
run: | | ||
# Fetch tags from the repository | ||
git fetch --tags | ||
# Get the latest tag and increment based on semantic versioning rules | ||
latest_tag=$(git tag --sort=-v:refname | head -n 1) | ||
if [ -z "$latest_tag" ]; then | ||
# If no tags exist, start at v0.1.0 | ||
new_tag="v0.1.0" | ||
else | ||
# Split the latest tag into major, minor, and patch | ||
echo "${latest_tag//v/}" | IFS='.' read -r major minor patch | ||
# Increment the patch version | ||
patch=$((patch + 1)) | ||
new_tag="v${major}.${minor}.${patch}" | ||
fi | ||
# Create and push the new tag | ||
git tag "$new_tag" | ||
git push origin "$new_tag" | ||
# Set the new_tag as an output | ||
echo "new_tag=$new_tag" >> $GITHUB_OUTPUT | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.OG_RELEASE_TAG_UPDATE }} | ||
# Output the new tag | ||
- name: Display new tag | ||
if: ${{ success() && steps.versioning.outcome == 'success' }} | ||
run: echo "Created new tag: ${{ steps.versioning.outputs.new_tag }}" | ||