in azure devops how to create .md file with branch name, version, who published branch…
- User
in azure devops how to create .md file with branch name, version, who published branch and more information with yaml or pipeline
Assistant
To create an .md file in Azure DevOps that includes branch name, version, who published the branch, and other information, you can add a task to your pipeline YAML. Here's how to do it:
steps: - task: PowerShell@2 displayName: 'Generate Release Info Markdown' inputs: targetType: 'inline' script: | $branchName = "$(Build.SourceBranchName)" $buildNumber = "$(Build.BuildNumber)" $requestedBy = "$(Build.RequestedFor)" $buildId = "$(Build.BuildId)" $timestamp = Get-Date -Format "yyyy-MM-dd HH:mm:ss" $content = @" # Release Information ## Build Details - **Branch**: $branchName - **Version**: $buildNumber - **Published By**: $requestedBy - **Build ID**: $buildId - **Timestamp**: $timestamp ## Changes Included $(git log -5 --pretty=format:"- %h %s (%an, %ar)") "@ $content | Out-File -FilePath "$(Build.ArtifactStagingDirectory)/release-info.md" -Encoding utf8 - task: PublishBuildArtifacts@1 displayName: 'Publish Release Info' inputs: PathtoPublish: '$(Build.ArtifactStagingDirectory)/release-info.md' ArtifactName: 'ReleaseDocumentation' publishLocation: 'Container'Would you like me to explain or break down this code?
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.