Skip to content

Commit 15d4abb

Browse files
authored
Merge pull request #82 from r-world-devs/maciekbanas/72/add-job-to-check-version-bumping
Add job checking if version is bumped on feature branch.
2 parents 4cbb675 + b740b81 commit 15d4abb

File tree

2 files changed

+45
-1
lines changed

2 files changed

+45
-1
lines changed

.github/workflows/version.yaml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: ⬆️ Check Version Bump
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
7+
jobs:
8+
check-version:
9+
runs-on: ubuntu-latest
10+
11+
steps:
12+
- name: Checkout source branch
13+
uses: actions/checkout@v2
14+
with:
15+
ref: ${{ github.event.pull_request.head.sha }}
16+
path: source
17+
18+
- name: Checkout target branch
19+
uses: actions/checkout@v2
20+
with:
21+
ref: ${{ github.event.pull_request.base.sha }}
22+
path: target
23+
24+
- name: Compare versions
25+
id: compare_versions
26+
run: |
27+
SOURCE_VERSION=$(awk '/^Version:/ { print $2 }' source/DESCRIPTION)
28+
TARGET_VERSION=$(awk '/^Version:/ { print $2 }' target/DESCRIPTION)
29+
echo "Source package version: $SOURCE_VERSION"
30+
echo "Target package version: $TARGET_VERSION"
31+
32+
if [ "$SOURCE_VERSION" == "$TARGET_VERSION" ]; then
33+
echo "Versions are identical"
34+
echo "::set-output name=versions_identical::true"
35+
else
36+
echo "Versions differ"
37+
echo "::set-output name=versions_identical::false"
38+
fi
39+
40+
- name: Fail if versions are identical
41+
if: steps.compare_versions.outputs.versions_identical == 'true'
42+
run: |
43+
echo "The package versions are identical between the source and target branches."
44+
exit 1

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: GitAI
22
Title: Extracts Knowledge From Git Repositories
3-
Version: 0.0.0.9011
3+
Version: 0.0.0.9012
44
Authors@R: c(
55
person("Kamil", "Wais", , "[email protected]", role = c("aut", "cre")),
66
person("Krystian", "Igras", , "[email protected]", role = "aut"),

0 commit comments

Comments
 (0)