PHPackages                             vijaycs85/notify-teams - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [CLI &amp; Console](/categories/cli)
4. /
5. vijaycs85/notify-teams

ActiveLibrary[CLI &amp; Console](/categories/cli)

vijaycs85/notify-teams
======================

Reusable MS Teams notification helper scripts for Azure container startup flows

1.0.0(1mo ago)0138↑810%MITShellCI passing

Since Jun 4Pushed 1mo agoCompare

[ Source](https://github.com/vijaycs85/notify-teams)[ Packagist](https://packagist.org/packages/vijaycs85/notify-teams)[ RSS](/packages/vijaycs85-notify-teams/feed)WikiDiscussions main Synced 1w ago

READMEChangelog (1)DependenciesVersions (2)Used By (0)

action-notify-teams
===================

[](#action-notify-teams)

Send deployment and container startup notifications to Microsoft Teams using Adaptive Cards. Works in two modes — as a **GitHub Action** for CI/CD pipeline events, or as a **shell script** for Azure container startup flows.

> **First time?** Follow [SETUP.md](./SETUP.md) to create your Teams Incoming Webhook URL.

---

Mode 1 — GitHub Action (Deployment Events)
------------------------------------------

[](#mode-1--github-action-deployment-events)

Use this in your GitHub Actions workflows to notify Teams when a deployment starts, succeeds, or fails.

### Inputs

[](#inputs)

NameDescriptionRequiredDefault`teams_webhook_url`MS Teams Incoming Webhook URL✅—`status``start`, `success`, or `failure`✅—`environment`Target environment (e.g. `dev`, `stg`, `prod`)✅—`project_name`Friendly project name shown on the card—`${{ github.repository }}``environment_url`URL of the deployed environment — adds an **Open environment** button——`message`Optional extra detail shown on the card——### Environment display names

[](#environment-display-names)

Short codes are automatically mapped to friendly labels:

InputDisplayed as`dev` / `development`Development`stg` / `stage` / `staging`Staging`prod` / `production`Productionanything elseCapitalised as-is### Basic usage — notify on start and completion

[](#basic-usage--notify-on-start-and-completion)

```
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      - name: Notify Teams — Deployment started
        uses: vijaycs85/notify-teams@v1
        with:
          teams_webhook_url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
          status: start
          environment: ${{ inputs.environment }}
          project_name: My App

      # ... your deployment steps ...

      - name: Notify Teams — Deployment result
        if: always()
        uses: vijaycs85/notify-teams@v1
        with:
          teams_webhook_url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
          status: ${{ job.status }}
          environment: ${{ inputs.environment }}
          project_name: My App
          environment_url: https://my-app-${{ inputs.environment }}.example.com
          message: Deployed by ${{ github.actor }} from branch ${{ github.ref_name }}
```

### Recommended pattern — reusable notification workflow

[](#recommended-pattern--reusable-notification-workflow)

Define a shared notification workflow once and call it from all your deployment workflows.

**`.github/workflows/notify.yml`** (in your project repo):

```
name: Notify Teams

on:
  workflow_call:
    inputs:
      status:
        required: true
        type: string
      environment:
        required: true
        type: string
      environment_url:
        required: false
        type: string
        default: ''
      message:
        required: false
        type: string
        default: ''
    secrets:
      MS_TEAMS_WEBHOOK_URL:
        required: true

jobs:
  notify:
    runs-on: ubuntu-latest
    steps:
      - uses: vijaycs85/notify-teams@v1
        with:
          teams_webhook_url: ${{ secrets.MS_TEAMS_WEBHOOK_URL }}
          status: ${{ inputs.status }}
          environment: ${{ inputs.environment }}
          environment_url: ${{ inputs.environment_url }}
          message: ${{ inputs.message }}
```

**Calling it from a deployment workflow:**

```
jobs:
  deploy:
    runs-on: ubuntu-latest
    steps:
      # ... your deployment steps ...

  notify:
    needs: deploy
    if: always()
    uses: ./.github/workflows/notify.yml
    secrets: inherit
    with:
      status: ${{ needs.deploy.result }}
      environment: production
      environment_url: https://my-app.example.com
```

---

Mode 2 — Shell Script (Azure Container Startup Events)
------------------------------------------------------

[](#mode-2--shell-script-azure-container-startup-events)

Use this when your Azure Container App (or any server) needs to post Teams cards on **restart**, **successful startup**, or **startup failure** — independently of GitHub Actions.

### Install via Composer

[](#install-via-composer)

Add this package to your project and configure it to install into your `.azure/` directory:

**In your project's `composer.json`:**

```
{
  "require": {
    "vijaycs85/notify-teams": "^1.0"
  },
  "extra": {
    "installer-paths": {
      ".azure/notify-teams/": ["vijaycs85/notify-teams"]
    }
  }
}
```

Then install:

```
composer require vijaycs85/notify-teams
```

The scripts will be available at `.azure/notify-teams/scripts/notify_teams.sh`.

### Required environment variables

[](#required-environment-variables)

Set these in your Azure Container App configuration (or equivalent):

VariableDescriptionRequired`TEAMS_WEBHOOK_URL`MS Teams Incoming Webhook URL✅`ENVIRONMENT`Environment name (e.g. `dev`, `staging`, `prod`)✅`WEBSITE_SITE_NAME`Auto-set by Azure — used as the container identifier—`PROJECT_NAME`Friendly project name — falls back to `WEBSITE_SITE_NAME`—`ENV_URL`URL shown as a link and button on the card—### Statuses

[](#statuses)

StatusCard colourMeaning`restart`🟡 WarningContainer has restarted, startup beginning`success`🟢 GoodAll startup steps completed`failure`🔴 AttentionA startup step failed### Integrate into your startup script

[](#integrate-into-your-startup-script)

Create `.azure/startup.sh` in your project (or update your existing one):

```
#!/bin/bash
set -euo pipefail

# Load the Teams notification helper
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$SCRIPT_DIR/notify-teams/scripts/notify_teams.sh"

# Send failure card automatically on any error
trap 'notify_teams failure "Script failed at line $LINENO. Check container logs."' ERR

# Notify: container has restarted, startup is beginning
notify_teams restart "Container startup initiated."

# ---------------------------------------------------------------------------
# Your application startup steps go here, for example:
#
#   php artisan migrate --force
#   php artisan cache:clear
#   composer install --no-dev --optimize-autoloader
# ---------------------------------------------------------------------------

# Notify: all steps succeeded
notify_teams success "All startup steps completed. Application is ready."
```

### Configure the startup script in Azure

[](#configure-the-startup-script-in-azure)

In your Azure Container App, set the startup command to:

```
/bin/bash /home/site/wwwroot/.azure/startup.sh

```

Or in `azure.yaml` / Bicep:

```
startupCommand: /bin/bash /home/site/wwwroot/.azure/startup.sh
```

###  Health Score

38

—

LowBetter than 83% of packages

Maintenance90

Actively maintained with recent releases

Popularity15

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity33

Early-stage or recently created project

 Bus Factor1

Top contributor holds 83.3% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Unknown

Total

1

Last Release

50d ago

### Community

Maintainers

![](https://avatars.githubusercontent.com/u/1220029?v=4)[Vijaya Chandran Mani](/maintainers/vijaycs85)[@vijaycs85](https://github.com/vijaycs85)

---

Top Contributors

[![vijaycs85](https://avatars.githubusercontent.com/u/1220029?v=4)](https://github.com/vijaycs85 "vijaycs85 (5 commits)")[![github-actions[bot]](https://avatars.githubusercontent.com/in/15368?v=4)](https://github.com/github-actions[bot] "github-actions[bot] (1 commits)")

---

Tags

shellnotificationazureTeamsGithub Actions

### Embed Badge

![Health badge](/badges/vijaycs85-notify-teams/health.svg)

```
[![Health](https://phpackages.com/badges/vijaycs85-notify-teams/health.svg)](https://phpackages.com/packages/vijaycs85-notify-teams)
```

###  Alternatives

[psy/psysh

An interactive shell for modern PHP.

9.8k582.3M832](/packages/psy-psysh)[mikehaertl/php-shellcommand

An object oriented interface to shell commands

32540.9M71](/packages/mikehaertl-php-shellcommand)[kevinlebrun/colors.php

Colors for PHP CLI scripts

3427.0M46](/packages/kevinlebrun-colorsphp)[mrrio/shellwrap

Use any command-line tool as a PHP function.

738214.3k2](/packages/mrrio-shellwrap)[marcocesarato/amwscan

AMWSCAN (Antimalware Scanner) is a php antimalware/antivirus scanner console script written in php for scan your project. This can work on php projects and a lot of others platform.

77619.3k2](/packages/marcocesarato-amwscan)[alecrabbit/php-console-spinner

Extremely flexible spinner for \[async\] php cli applications

24038.0k2](/packages/alecrabbit-php-console-spinner)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
