-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
62 lines (53 loc) · 1.86 KB
/
action.yml
File metadata and controls
62 lines (53 loc) · 1.86 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
name: "Deployment Environment Resolver"
description: "Resolve deployment environment from workflow_dispatch inputs, branch/ref mapping, or tag patterns with wildcard support"
author: "code4mk"
branding:
icon: "git-branch"
color: "blue"
inputs:
input-mapping:
description: "Mapping for workflow_dispatch inputs (key=value per line, e.g. prod=production)"
required: false
ref-mapping:
description: "Mapping for branch/ref names with wildcard support (pattern=env per line, e.g. main=prod)"
required: false
tag-mapping:
description: "Mapping for tag patterns (pattern=env per line, e.g. v*=prod)"
required: false
default-env:
description: "Fallback environment if no mapping matches"
required: false
default: "dev"
strict:
description: "Fail the step if no mapping matches and no default is set"
required: false
default: "false"
debug:
description: "Enable debug logging"
required: false
default: "false"
outputs:
environment:
description: "Resolved environment name"
value: ${{ steps.resolve.outputs.environment }}
match-source:
description: "How the environment was resolved (input | ref | tag | default)"
value: ${{ steps.resolve.outputs.match_source }}
runs:
using: "composite"
steps:
- name: Resolve environment
id: resolve
shell: bash
run: bash "${{ github.action_path }}/scripts/resolve-env.sh"
env:
EVENT_NAME: ${{ github.event_name }}
REF_NAME: ${{ github.ref_name }}
REF_TYPE: ${{ github.ref_type }}
INPUT_ENV: ${{ github.event.inputs.environment }}
INPUT_MAPPING: ${{ inputs.input-mapping }}
REF_MAPPING: ${{ inputs.ref-mapping }}
TAG_MAPPING: ${{ inputs.tag-mapping }}
DEFAULT_ENV: ${{ inputs.default-env }}
STRICT_MODE: ${{ inputs.strict }}
DEBUG_MODE: ${{ inputs.debug }}