-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (61 loc) · 2.61 KB
/
version.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
name: version
on:
workflow_call: # https://docs.github.com/actions/using-workflows/reusing-workflows#using-inputs-and-secrets-in-a-reusable-workflow
outputs:
short_sha:
description: 'version short hash of the commit size 8'
value: ${{ jobs.version-check.outputs.short_sha }}
sha:
description: 'version short hash of the commit'
value: ${{ jobs.version-check.outputs.sha }}
tag_name:
description: 'tag name, if not tag will null'
value: ${{ jobs.version-check.outputs.tag_name }}
cc_version:
description: 'conventional version'
value: ${{ jobs.version-check.outputs.cc_version }}
cc_date:
description: 'conventional date'
value: ${{ jobs.version-check.outputs.cc_date }}
cc_changes:
description: 'conventional change logs'
value: ${{ jobs.version-check.outputs.cc_changes }}
cc_status:
description: 'conventional change status, released or prereleased'
value: ${{ jobs.version-check.outputs.cc_status }}
jobs:
version-check:
name: version-check
runs-on: ${{ matrix.os }}
strategy:
matrix:
include:
- build: linux
os: ubuntu-latest
target: x86_64-unknown-linux-gnu
outputs:
short_sha: ${{ steps.check-version.outputs.short-sha }}
sha: ${{ steps.check-version.outputs.sha }}
tag_name: ${{ steps.check-version.outputs.tag-version }}
cc_version: ${{ steps.check-version.outputs.cc-latest-version }}
cc_date: ${{ steps.check-version.outputs.cc-latest-date }}
cc_changes: ${{ steps.check-version.outputs.cc-latest-changes-log }}
cc_status: ${{ steps.check-version.outputs.cc-latest-status }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: get version and conventional
id: check-version
uses: convention-change/[email protected] # or change to latest version
with:
sha-length: 8
- name: check version and conventional
run: |
echo "sha: ${{ steps.check-version.outputs.sha }}"
echo "env SHA-SHORT: ${{ env.SHA-SHORT }}"
echo "short-sha: ${{ steps.check-version.outputs.short-sha }}"
echo "tag-version: ${{ steps.check-version.outputs.tag-version }}"
echo "env GIT_TAG_VERSION: ${{ env.GIT_TAG_VERSION }}"
echo "cc-latest-version: ${{ steps.check-version.outputs.cc-latest-version }}"
echo "cc-latest-date: ${{ steps.check-version.outputs.cc-latest-date }}"
echo "cc-latest-status: ${{ steps.check-version.outputs.cc-latest-status }}"