-
Notifications
You must be signed in to change notification settings - Fork 0
71 lines (58 loc) · 1.72 KB
/
main.yml
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
name: repo-tests
on:
workflow_dispatch:
pull_request:
push:
branches: [ master ]
jobs:
gitchangelog_test:
strategy:
fail-fast: false
matrix:
os: [ubuntu-22.04, ubuntu-20.04]
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
name: Test changelog
steps:
# To use this repository's private action,
# you must check out the repository
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Get version
if: matrix.os == 'ubuntu-20.04'
id: get_version
run: |
echo "VERSION=$(git describe --abbrev=0 --tags)" >> $GITHUB_ENV
echo ${{ env.VERSION }}
- name: Unset version
if: matrix.os == 'ubuntu-20.04'
id: rm_version
run: |
echo "GIT_TAG=$(git describe --abbrev=0 --tags)"
[[ -z $TAG ]] || git tag --delete $TAG
- name: gitchangelog action step (debug)
uses: ./ # Uses an action in the root directory
with:
github_token: ${{ secrets.GITHUB_TOKEN}}
- name: Display changes file
run: cat CHANGES.md
- name: Test changes file
run: |
export VERSION=${{ env.VERSION }}
export TITLE_VERSION=$(cat CHANGES.md | head -n1 | cut -f2 -d" ")
if [[ -z $VERSION ]]; then
[[ "${TITLE_VERSION}" == "(unreleased)" ]] || exit 1
else
[[ "${TITLE_VERSION}" == "${VERSION}" ]] || exit 1
fi
- name: Checkout test repo
uses: actions/checkout@v4
with:
repository: sarnold/gitchangelog
path: vendor/gcl-test
- name: Display subdir result
run: ls -l vendor/