generated from insightsengineering/r.pkg.template
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (43 loc) · 1.24 KB
/
version.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
---
name: Version check 🏁
on:
push:
branches:
- main
pull_request:
types:
- opened
- synchronize
- reopened
- ready_for_review
branches:
- main
workflow_dispatch:
workflow_call:
concurrency:
group: version-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
version:
name: Version check 🏁
runs-on: ubuntu-latest
if: >
!contains(github.event.commits[0].message, '[skip version]')
&& github.event.pull_request.draft == false
steps:
- name: Checkout repo 🛎
uses: actions/checkout@v3
- name: NEWS.md and DESCRIPTION Version check 🏁
run: |
DESC_VERSION=$(awk -F: '/Version:/{gsub(/[ ]+/,"") ; print $2}' DESCRIPTION)
NEWS_VERSION=$(awk '/^#+ /{print $3; exit}' NEWS.md)
echo "NEWS.md version: $NEWS_VERSION"
echo "DESCRIPTION version: $DESC_VERSION"
if (test $DESC_VERSION = $NEWS_VERSION ); then
echo "NEWS.md and DESCRIPTION have the same version"
else
echo "🙈 NEWS.md and DESCRIPTION have different versions!"
echo "🙏 Please fix this."
exit 1
fi
shell: bash