-
-
Notifications
You must be signed in to change notification settings - Fork 11
/
action.yml
86 lines (78 loc) · 3.23 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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
name: Create GitHub Releases based on changelog
description: GitHub Action for creating GitHub Releases based on changelog
inputs:
changelog:
description: Path to changelog (variables `$tag`, `$version`, `$prefix`, and any string)
required: false
allow-missing-changelog:
description: >
Create the release even if the changelog entry corresponding to the version is missing.
The default value of the changelog will be an empty string.
required: false
default: 'false'
title:
description: Format of title (variables `$tag`, `$version`, `$prefix`, and any string)
required: false
default: '$tag'
draft:
description: Create a draft release ('true' or 'false')
required: false
default: 'false'
branch:
description: Reject releases from commits not contained in branches that match the specified pattern (regular expression)
required: false
prefix:
description: >
An optional pattern that matches a prefix for the release tag, before the
version number.
If a prefix is provided, an optional '-' character is permitted (but not
required) between the prefix and the version number. For example, the
tags 'my-crate-v0.1.2' and 'my-crate0.1.0' both have the prefix 'my-crate'.
This is interpreted as a bash-style regular expression, so it may be used
to match multiple prefix strings. Therefore, literal characters that
are part of bash's regular expression syntax, such as `$`, `^`, `[`, `]`,
`{`, `}`, `(`, `)`, and `|` must be escaped if they occur in the prefix
pattern.
If a prefix pattern is provided, the portion of the tag that matched the
prefix can be interpolated into `title` and `changelog` via the `$prefix`
variable.
required: false
default: ''
token:
description: >
GitHub token for creating GitHub Releases.
If not set this option, the GITHUB_TOKEN environment variable will be used.
required: false
ref:
description: >
Fully-formed tag ref for this release.
If not set this option, the GITHUB_REF environment variable (automatically set by GitHub Actions) will be used.
required: false
outputs:
computed-prefix:
description: >
The computed prefix, including '-' and 'v' if found.
value: ${{ steps.main.outputs.computed-prefix }}
version:
description:
The version number extracted from the tag. The tag name is a concatenation of computed-prefix
and version.
value: ${{ steps.main.outputs.version }}
# Note:
# - inputs.* should be manually mapped to INPUT_* due to https://github.com/actions/runner/issues/665
# - Use GITHUB_*/RUNNER_* instead of github.*/runner.* due to https://github.com/actions/runner/issues/2185
runs:
using: composite
steps:
- id: main
run: bash --noprofile --norc "${GITHUB_ACTION_PATH:?}/main.sh"
shell: bash
env:
INPUT_CHANGELOG: ${{ inputs.changelog }}
INPUT_ALLOW_MISSING_CHANGELOG: ${{ inputs.allow-missing-changelog }}
INPUT_TITLE: ${{ inputs.title }}
INPUT_DRAFT: ${{ inputs.draft }}
INPUT_BRANCH: ${{ inputs.branch }}
INPUT_PREFIX: ${{ inputs.prefix }}
INPUT_TOKEN: ${{ inputs.token }}
INPUT_REF: ${{ inputs.ref }}