From f6b4211101b2db99dd6aa56925c28166327622e8 Mon Sep 17 00:00:00 2001 From: Xavier Tremblay Date: Mon, 25 Sep 2023 14:17:14 -0400 Subject: [PATCH] Feature/idp 602 add jira workflow (#35) * Add jira workflow --- .github/workflows/jira.yml | 34 +++++++++++++++++++ .../ParameterUsageAnalyzer.cs | 2 +- 2 files changed, 35 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/jira.yml diff --git a/.github/workflows/jira.yml b/.github/workflows/jira.yml new file mode 100644 index 0000000..2aa8d85 --- /dev/null +++ b/.github/workflows/jira.yml @@ -0,0 +1,34 @@ +name: Jira + +on: + pull_request: + branches: [main] + paths-ignore: ["*.md"] + +jobs: + main: + runs-on: ubuntu-latest + steps: + - name: Check Jira Story + shell: pwsh + run: | + Install-Module JiraPS -Scope CurrentUser -Force + if ("$env:GITHUB_HEAD_REF" -like "*/renovate/*" -eq $True) + { + Write-Host "Skipping, renovate branch detected" + return + } + + Set-JiraConfigServer -Server "${{ secrets.JIRA_URL }}" + if("$env:GITHUB_HEAD_REF" -match "IDP-[0-9]+" -eq $False) + { + throw "Branch name $env:GITHUB_HEAD_REF doesn't respect the required pattern." + } + + $JiraIssueKey = $Matches[0] + $PWord = ConvertTo-SecureString -String "${{ secrets.JIRA_API_TOKEN }}" -AsPlainText -Force + $Credential = New-Object -TypeName System.Management.Automation.PSCredential -ArgumentList "${{ secrets.JIRA_USERNAME }}", $PWord + + Write-Host "Retrieving Jira issue with number $JiraIssueKey" + Get-JiraIssue -Key $JiraIssueKey -Credential $Credential -ErrorAction Stop | out-null + Write-Host "Successfully retrieved Jira issue" diff --git a/src/Workleap.Extensions.MediatR.Analyzers/ParameterUsageAnalyzer.cs b/src/Workleap.Extensions.MediatR.Analyzers/ParameterUsageAnalyzer.cs index 914c910..e7f47d8 100644 --- a/src/Workleap.Extensions.MediatR.Analyzers/ParameterUsageAnalyzer.cs +++ b/src/Workleap.Extensions.MediatR.Analyzers/ParameterUsageAnalyzer.cs @@ -11,7 +11,7 @@ public sealed class ParameterUsageAnalyzer : DiagnosticAnalyzer { internal static readonly DiagnosticDescriptor UseGenericParameterRule = new DiagnosticDescriptor( id: RuleIdentifiers.UseGenericParameter, - title: "Use generic method instead", + title: "Use DomainEvent attribute on ", messageFormat: "Use generic method instead", category: RuleCategories.Design, defaultSeverity: DiagnosticSeverity.Warning,