Skip to content

Commit

Permalink
tech: refactor github comment to use Capgemini Microsoft Bot (#136)
Browse files Browse the repository at this point in the history
* tech: refactor github comment to use Capgemini Microsoft Bot

* feat: conditional run delete github comment

* fix: repo owner and name passed together

* fix: `dependencies` to `stageDependencies`

* fix: set comment id to a variable
  • Loading branch information
tdashworth authored Sep 26, 2022
1 parent c88f2a2 commit e45afd0
Showing 1 changed file with 16 additions and 6 deletions.
22 changes: 16 additions & 6 deletions templates/build-and-test-stages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,15 @@ stages:
- job: ManualValidationCommentJob
displayName: Manual validation (comment)
steps:
- task: GitHubComment@0
- task: GitHubAppCreateIssueComment@1
name: CreateComment
inputs:
gitHubConnection: 'github.com_tdashworth'
repositoryName: '$(RepositoryName)'
comment: |
privateKey: capgemini-microsoft-bot.private-key.pem
appId: 236185
repo: $(Build.Repository.Name)
body: |
**Manual validation requested**
Please perform any checks required on $(BuildTools.EnvironmentUrl) then approve $(BuildUrl).
Please perform any checks required on $(BuildTools.EnvironmentUrl) then approve $(BuildUrl).
- job: ManualValidationJob
displayName: Manual validation
pool: server
Expand All @@ -127,6 +129,7 @@ stages:
condition: ne(dependencies.ProvisionEnvironment.outputs['ProvisionEnvironmentJob.SetEnvironmentOutputVariables.EnvironmentUrl'], '')
variables:
BuildTools.EnvironmentUrl: $[ stageDependencies.ProvisionEnvironment.ProvisionEnvironmentJob.outputs['SetEnvironmentOutputVariables.EnvironmentUrl'] ]
CreateComment.CommentId: $[ stageDependencies.ManualValidation.ManualValidationCommentJob.outputs['CreateComment.CommentId'] ]
jobs:
- job: DeleteEnvironmentJob
displayName: Delete environment
Expand All @@ -141,4 +144,11 @@ stages:
continueOnError: true
inputs:
authenticationType: PowerPlatformSPN
PowerPlatformSPN: Dataverse (placeholder)
PowerPlatformSPN: Dataverse (placeholder)
- task: GitHubAppDeleteIssueComment@1
condition: ne(variables['CreateComment.CommentId'], '')
inputs:
privateKey: capgemini-microsoft-bot.private-key.pem
appId: 236185
repo: $(Build.Repository.Name)
commentId: $(CreateComment.CommentId)

0 comments on commit e45afd0

Please sign in to comment.