Git Action Teams 알람 설정하기
2022. 7. 27. 17:39ㆍgit
사용 이유
Git Action이 진행 될 때 CI/CD가 성공, 실패 시 Teams에 개발자 또는 관련된 사람들에게 알람을 보내준다.
순서
- Teams 연결 링크 만들기
- Git Action Secret에 연결링크 저장
- Teams 연결 Marketplace 복사
- yml파일에 Marketplace 코드를 넣고 Git Action Secret를 넣어준다.
1. Teams 연결 링크 만들기
Teams 연결 링크 만들기 : https://crispypotato.tistory.com/233
2. Git Action Secret에 연결링크 저장
3. Teams 연결 Marketplace 복사
해당 링크에서 최신 버전을 코드를 복사 한다.
https://github.com/marketplace/actions/microsoft-teams-deploy-card
4.yml파일에 Marketplace 코드를 넣고 Git Action Secret를 넣어준다.
*Git Action Secret 은 ex) ${{secrets.000}} 형식으로 가져온다.
webhook-uri: ${{ secrets.TEAMS }}
- name: CI Fail
uses: toko-bifrost/ms-teams-deploy-card@3.1.2
with:
github-token: ${{ github.token }}
webhook-uri: ${{ secrets.TEAMS }}
card-layout-exit: complete
if: failure()
ex)
on:
push:
branches:
- test
env:
CRYPTO: ${{ secrets.CRYPTO }}
JWT: ${{ secrets.JWT }}
PORT: ${{ secrets.PORT }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Set up Node.js version
uses: actions/setup-node@v1
with:
node-version: '16.x'
- name: Download Static File
run: |
mkdir data
curl -o ${{github.workspace}}/data/coco.json https://test.net/back-data/coco.json
curl -o ${{github.workspace}}/data/daily.json https://test.net/back-data/daily.json
- name: Install packages
run: npm i
- name: Run Unit Test
run: npm run test
- name: CI Fail
uses: toko-bifrost/ms-teams-deploy-card@3.1.2
with:
github-token: ${{ github.token }}
webhook-uri: ${{ secrets.TEAMS }}
card-layout-exit: complete
if: failure()
728x90
반응형
'git' 카테고리의 다른 글
Git Action CI (Test Code 검증, 실패 처리) (0) | 2022.07.27 |
---|---|
Git tag 사용 방법 (0) | 2022.01.11 |
Git action static 파일 삽입 (curl, azure blob, aws s3) (0) | 2022.01.05 |
Git action 기본 변수 확인 방법 (0) | 2022.01.05 |
Git bash 계정 (아이디 / 이메일) (확인 / 변경) 방법 (0) | 2021.08.23 |