-
-
Notifications
You must be signed in to change notification settings - Fork 1
/
action.yml
64 lines (61 loc) · 2.28 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
55
56
57
58
59
60
61
62
63
64
name: Sync release version.
description: Update files that reference a project version with a new release number.
author: tj-actions
inputs:
current_version:
description: 'The current project version (Default: The last git tag).'
required: false
new_version:
description: 'The next project version (Default: The new git tag).'
required: false
paths:
description: 'A list of file names to search and replace versions.'
required: true
pattern:
description: 'The pattern to match the location that needs to be updated.'
required: false
default: ''
only_major:
description: 'Only update the major version number.'
required: false
default: 'false'
strip_prefix:
description: 'Prefix to strip from the tag. For example if `strip_prefix` is set to `v` and the tag is `v1.0.0` the output becomes `1.0.0`.'
required: false
default: ''
outputs:
is_initial_release:
description: 'Boolean indicating an initial release.'
value: ${{ steps.sync-release-version.outputs.is_initial_release }}
new_version:
description: 'The current project version'
value: ${{ steps.sync-release-version.outputs.new_version }}
old_version:
description: 'The previous project version'
value: ${{ steps.sync-release-version.outputs.old_version }}
major_update:
description: 'Boolean indicating a major version bump'
value: ${{ steps.sync-release-version.outputs.major_update }}
runs:
using: 'composite'
steps:
- run: |
bash $GITHUB_ACTION_PATH/entrypoint.sh
id: sync-release-version
shell: bash
env:
GITHUB_SERVER_URL: ${{ github.server_url }}
GITHUB_REPOSITORY: ${{ github.repository }}
GITHUB_REF: ${{ github.ref }}
GITHUB_ACTION_PATH: ${{ github.action_path }}
GITHUB_EVENT_NAME: ${{ github.event_name }}
# https://docs.github.com/en/actions/creating-actions/metadata-syntax-for-github-actions#example-specifying-inputs
INPUT_CURRENT_VERSION: ${{ inputs.current_version }}
INPUT_NEW_VERSION: ${{ inputs.new_version }}
INPUT_PATHS: ${{ inputs.paths }}
INPUT_PATTERN: ${{ inputs.pattern }}
INPUT_ONLY_MAJOR: ${{ inputs.only_major }}
INPUT_STRIP_PREFIX: ${{ inputs.strip_prefix }}
branding:
icon: arrow-up
color: white