forked from orhun/git-cliff
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
54 lines (47 loc) · 1.43 KB
/
action.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
name: Run a fixtures test
description: Run a fixtures test
inputs:
fixtures-dir:
description: Path to the fixtures directory
required: true
command:
description: The git-cliff command to run
required: false
default: ""
date-format:
description: The date format to use
required: false
default: "%Y-%m-%d"
runs:
using: composite
steps:
- name: Install toolchain
uses: dtolnay/rust-toolchain@nightly
- name: Install git-cliff
run: cargo install --path git-cliff/
shell: bash
- name: Set git config
run: |
git config --global user.name "github-actions[bot]"
git config --global user.email "github-actions[bot]@users.noreply.github.com"
shell: bash
- name: Create commits and tags
working-directory: ${{ inputs.fixtures-dir }}
run: |
git init
./commit.sh
shell: bash
- name: Generate a changelog
working-directory: ${{ inputs.fixtures-dir }}
run: git cliff --config cliff.toml ${{ inputs.command }} > output.md
shell: bash
- name: Compare the output with the expected output
working-directory: ${{ inputs.fixtures-dir }}
env:
IN_DATE_FORMAT: ${{ inputs.date-format }}
run: |
cat output.md
current_date=$(date +"$IN_DATE_FORMAT")
sed -i "s/<<DATE>>/$current_date/g" expected.md
diff --strip-trailing-cr output.md expected.md
shell: bash