generated from actions/typescript-action
-
Notifications
You must be signed in to change notification settings - Fork 0
/
action.yml
73 lines (71 loc) · 2.05 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
name: talview/release-action
description: 'Release automation action'
author: 'talview'
branding:
icon: 'heart'
color: 'red'
inputs:
FORCE_PUSH:
description: 'force push to update ref'
required: false
default: 'false'
VERSION:
description: 'semver: major, minor or patch'
required: false
default: 'minor'
BASE:
description: 'branch to merge back code to (i.e. develop)'
default: 'refs/heads/develop'
required: false
VERSION_PREFIX:
description: 'tag prefix'
default: ''
required: false
ASSETS:
description: 'glob for assets to publish in release'
required: false
BOT_ID:
description: 'bot id to run with'
required: true
BOT_KEY:
description: 'bot ssh key to generate token'
required: true
runs:
using: 'composite'
steps:
- name: Use Node.js 20.x
uses: actions/setup-node@v4
if: contains(github.actor,'bot') == false
with:
node-version: 20.x
- name: Generate a token
if: contains(github.actor,'bot') == false
id: generate-token
uses: actions/create-github-app-token@v1
with:
app-id: ${{ inputs.BOT_ID }}
private-key: ${{ inputs.BOT_KEY }}
- name: git config
shell: bash
if: contains(github.actor,'bot') == false
run: |
git config user.name "${GITHUB_ACTOR}"
git config user.email "${GITHUB_ACTOR}@users.noreply.github.com"
- name: publish
shell: bash
if: contains(github.actor,'bot') == false
run: |
cd ${WORKSPACE}
npm version ${VERSION} --no-git-tag-version
npx auto-changelog -t keepachangelog -p -u
cd ${ACTION_PATH}
node ${ACTION_PATH}/dist/index.js
env:
ACTION_PATH: ${{ github.action_path }}
WORKSPACE: ${{ github.workspace }}
VERSION: ${{ inputs.VERSION }}
BASE: ${{ inputs.BASE }}
ASSETS: ${{ inputs.ASSETS }}
FORCE_PUSH: ${{ inputs.FORCE_PUSH }}
VERSION_PREFIX: ${{ inputs.VERSION_PREFIX }}
GITHUB_TOKEN: ${{ steps.generate-token.outputs.token }}