Skip to content

Commit

Permalink
Merge pull request #252 from redhatci/version-consistency
Browse files Browse the repository at this point in the history
add a CI check for version consistency
  • Loading branch information
fredericlepied authored Apr 10, 2024
2 parents 29b0ce9 + e2f4e82 commit fb51820
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 3 deletions.
13 changes: 12 additions & 1 deletion .github/workflows/pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ jobs:
check-unmerged-pr: true

check-docs:
name: Check documentation and README
name: Check version, documentation and README
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand All @@ -171,4 +171,15 @@ jobs:
if grep -q Missing: ${GITHUB_STEP_SUMMARY}; then
exit 1
fi
- name: Check versions are consistent between rpm spec and galaxy.yml
run: |
echo "# Inconsistent versions" > ${GITHUB_STEP_SUMMARY}
spec_version=$(grep Version: ansible-collection-redhatci-ocp.spec | awk '{print $2}' | cut -d. -f1,2)
galaxy_version=$(grep version: galaxy.yml | awk '{print $2}' | cut -d. -f1,2)
if [ "$spec_version" != "$galaxy_version" ]; then
echo "- Inconsistent: rpm spec: ${spec_version} galaxy: ${galaxy_version}" | tee -a ${GITHUB_STEP_SUMMARY}
exit 1
fi
...
4 changes: 2 additions & 2 deletions galaxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,9 @@ name: ocp

# The version of the collection. Must be compatible with semantic versioning
# Always leave patch version as .0
# Patch version is replaced from commit date in epoch format
# Patch version is replaced from commit date in UNIX epoch format
# example: 0.3.2147483647
version: 0.3.0
version: 0.5.0

# The path to the Markdown (.md) readme file.
readme: README.md
Expand Down

0 comments on commit fb51820

Please sign in to comment.