-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathaction.yml
More file actions
67 lines (65 loc) · 2.09 KB
/
action.yml
File metadata and controls
67 lines (65 loc) · 2.09 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: Send Teams Notification
description: Send an Adaptive Card to Microsoft Teams via webhook (PowerShell)
branding:
color: blue
icon: message-circle
inputs:
job_status:
description: Status of the calling job (success, failure, cancelled)
required: true
commit_messages:
description: 'JSON array for a FactSet (e.g., [{ "title": "SHA", "value": "Message" }])'
required: false
default: "[]"
environment:
description: Deployment environment name
required: false
default: ""
card_title:
description: Title for the adaptive card
required: false
default: "🔔 GitHub Deployment"
repository:
description: Repository name to display (defaults to GITHUB_REPOSITORY)
required: false
default: ""
actor:
description: Actor name to display (defaults to GITHUB_ACTOR)
required: false
default: ""
webhook_url:
description: Teams incoming webhook URL
required: true
run_id:
description: GitHub Actions run ID (for link to the run)
required: false
default: ""
outputs:
sent:
description: Whether a POST to Teams was attempted/sent
value: ${{ steps.send.outputs.sent }}
payload_bytes:
description: Size of the JSON payload in bytes
value: ${{ steps.send.outputs.payload_bytes }}
run_url:
description: URL to the workflow run (computed from context)
value: ${{ steps.send.outputs.run_url }}
runs:
using: composite
steps:
- name: Send Adaptive Card via PowerShell
id: send
shell: pwsh
env:
INPUT_JOB_STATUS: ${{ inputs.job_status }}
INPUT_COMMIT_MESSAGES: ${{ inputs.commit_messages }}
INPUT_ENVIRONMENT: ${{ inputs.environment }}
INPUT_CARD_TITLE: ${{ inputs.card_title }}
INPUT_REPOSITORY: ${{ inputs.repository }}
INPUT_ACTOR: ${{ inputs.actor }}
INPUT_WEBHOOK_URL: ${{ inputs.webhook_url }}
GITHUB_REPO_FALLBACK: ${{ github.repository }}
GITHUB_ACTOR_FALLBACK: ${{ github.actor }}
GITHUB_RUN_ID: ${{ inputs.run_id || github.run_id }}
run: |
& "${{ github.action_path }}\scripts\send-teams.ps1"