This repository was archived by the owner on Dec 8, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaction.yaml
More file actions
67 lines (61 loc) · 2 KB
/
action.yaml
File metadata and controls
67 lines (61 loc) · 2 KB
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: 'Automated Tag Creator '
description: 'Track version changes in local files for automatic tag creation'
author: 'smartforce-io'
inputs:
type:
description: 'File to track version of the app'
required: true
secrets:
description: 'Token to access repository'
required: true
behavior:
description: 'Determines which commit to read the version from.
Use "after" (default) to read version from the current commit,
or "before" to read version from the previous commit'
required: false
default: after
template:
description: 'The default template is "v{{.Version}}'
required: false
default: v{{.Version}}
regex:
description: 'Create regex string if you are not using the default ATC package manager.
The regexstr must contain one group with version number.'
required: false
default: 'version: (.+)'
runs:
using: 'composite'
steps:
- name: Check OS
shell: bash
run: |
if [[ "${{ runner.os }}" != "Linux" ]]; then
echo "::error::This action can only be run on Linux"
exit 1
fi
- name: Check type file
shell: bash
run: |
if [[ ! -f "${{ inputs.type }}" ]]; then
echo "::error::Config file not found: ${{ inputs.type }}"
fi
echo "Config file found: ${{ inputs.type }}"
- name: Set up Go
uses: actions/setup-go@4dc6199c7b1a012772edbd06daecab0f50c9053c # v6
with:
go-version-file: ${{ github.action_path }}/go.mod
- name: Build Automated Tag Creator
shell: bash
run: go build -C "${{ github.action_path }}" -o atc
- name: Run Automated Tag Creator
shell: bash
env:
GITHUB_TOKEN: ${{ inputs.secrets }}
FILE_TYPE: ${{ inputs.type }}
COMMIT_SHA: ${{ github.sha }}
GITHUB_REPOSITORY: ${{ github.repository }}
BEHAVIOR: ${{ inputs.behavior }}
TEMPLATE: ${{ inputs.template }}
REGEX: ${{ inputs.regex }}
CI_MODE: true
run: ${{ github.action_path }}/atc