[opencti] update to 6.5.0 #116
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: validate-release | |
on: | |
pull_request: | |
types: [opened, synchronize, reopened, labeled, unlabeled] | |
permissions: | |
contents: read | |
jobs: | |
validate-release: | |
if: contains(github.event.pull_request.labels.*.name, 'release') | |
name: gocti-version | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Verify that changelog version was updated | |
run: | | |
UNRELEASED=$(sed -n '/^\#\# \[Unreleased\]/p' ./CHANGELOG.md | head -1) | |
if [ -n "$UNRELEASED" ]; then | |
echo "Changelog cannot contain an \"[Unreleased]\" section when releasing" | |
exit 1 | |
fi | |
- name: Find staged version | |
run: | | |
STAGED=$(sed -En "s/^\#\# \[(.*)\] \- [0-9]{4}\-[0-9]{2}\-[0-9]{2}$/\1/p" ./CHANGELOG.md | head -1) | |
if [ -z $STAGED ]; then | |
echo "Could not find staged version" | |
exit 1 | |
fi | |
echo "STAGED_VERSION=$STAGED" >> "$GITHUB_ENV" | |
echo "Staged release of version v$STAGED" | |
- name: Verify application version | |
run: | | |
APP=$(sed -n 's/\tgoctiVersion = "\([0-9]*.[0-9]*.[0-9]*\)"$/\1/p' ./gocti.go | head -1) | |
if [ "$APP" != "$STAGED_VERSION" ]; then | |
echo "Mismatch between staged version $STAGED_VERSION and app version in gocti.go $APP" | |
exit 1 | |
fi | |
validate-non-release: | |
if: ${{ ! contains(github.event.pull_request.labels.*.name, 'release') }} | |
name: non-release | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Verify that there is an "Unreleased" section | |
run: | | |
UNRELEASED=$(sed -n '/^\#\# \[Unreleased\]/p' ./CHANGELOG.md | head -1) | |
if [ -z "$UNRELEASED" ]; then | |
echo "Changelog must contain an \"[Unreleased]\" section if you are not releasing" | |
exit 1 | |
fi |