Skip to content

Teams Check Fix #282

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 19, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 15 additions & 1 deletion .github/workflows/im-reusable-finish-deployment-workflow.yml
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,20 @@ jobs:
runs-on: ${{ inputs.runs-on }}
environment: ${{ inputs.gh-secrets-environment }}
steps:
- name: Check if workflow should post to teams
uses: actions/github-script@v7
with:
script: |
// Some teams have these as a secret and some as a var, allow either way but if not present do not post
const teamsUri = '${{ inputs.ms-teams-uri || secrets.MS_TEAMS_URI }}';
if (!teamsUri || teamsUri.trim().length === 0){
core.info('The MS_TEAMS_URI secret or the ms-teams-uri input must be provided to post to teams. A post will not be made.');
core.exportVariable('POST_TO_TEAMS', false);
}
else {
core.exportVariable('POST_TO_TEAMS', true);
}

- name: Print inputs
uses: actions/github-script@v7
with:
Expand Down Expand Up @@ -200,7 +214,7 @@ jobs:
FACTS: ${{ inputs.custom-facts-for-team-channel }}

- name: Send status to team's notification channel
if: always() && (inputs.ms-teams-uri || secrets.MS_TEAMS_URI)
if: always() && env.POST_TO_TEAMS == 'true'
uses: im-open/post-status-to-teams-action@v1.4
with:
title: ${{ inputs.title-of-teams-post }}
Expand Down