Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add job checking if version is bumped on feature branch. #82

Merged
merged 2 commits into from
Dec 27, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
44 changes: 44 additions & 0 deletions .github/workflows/version.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,44 @@
name: ⬆️ Check Version Bump

on:
pull_request:
branches: [main]

jobs:
check-version:
runs-on: ubuntu-latest

steps:
- name: Checkout source branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.head.sha }}
path: source

- name: Checkout target branch
uses: actions/checkout@v2
with:
ref: ${{ github.event.pull_request.base.sha }}
path: target

- name: Compare versions
id: compare_versions
run: |
SOURCE_VERSION=$(awk '/^Version:/ { print $2 }' source/DESCRIPTION)
TARGET_VERSION=$(awk '/^Version:/ { print $2 }' target/DESCRIPTION)
echo "Source package version: $SOURCE_VERSION"
echo "Target package version: $TARGET_VERSION"

if [ "$SOURCE_VERSION" == "$TARGET_VERSION" ]; then
echo "Versions are identical"
echo "::set-output name=versions_identical::true"
else
echo "Versions differ"
echo "::set-output name=versions_identical::false"
fi

- name: Fail if versions are identical
if: steps.compare_versions.outputs.versions_identical == 'true'
run: |
echo "The package versions are identical between the source and target branches."
exit 1
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: GitAI
Title: Extracts Knowledge From Git Repositories
Version: 0.0.0.9011
Version: 0.0.0.9012
Authors@R: c(
person("Kamil", "Wais", , "[email protected]", role = c("aut", "cre")),
person("Krystian", "Igras", , "[email protected]", role = "aut"),
Expand Down
Loading