AZ-400 Question 49
Select 2Your development team stores its source code in Azure Repos (Git) and wants to automate generating a 'CHANGELOG.md' file from commit messages. The file should be updated whenever changes are merged into the main branch and then pushed back to the repository. Which two tasks must you include in your Azure DevOps YAML pipeline to achieve this?
- A
A script task that parses commit messages and appends new entries to a 'CHANGELOG.md' file
- B
A standalone 'Publish Pipeline Artifact' task to upload the changelog for manual inspection
- C
Configuration of 'Checkout' to persist credentials so the pipeline can commit and push updates
- D
A manual gating process that requires a project administrator to approve the new changelog before pushing
Show answer and explanation
Correct answers: A, C
Explanation
In an automated documentation workflow, a typical approach is to parse Git commit messages and generate changelog entries programmatically. The pipeline must have permission to push changes back to the repository, which is why configuring the 'Checkout' step with persisted credentials is essential. Refer to Microsoft� Azure DevOps documentation on �YAML Pipelines� and �Checkout� for best practices on enabling credential persistence.
- A. Correct.
Correct. You need a task capable of reading commit messages (usually via a script, custom tooling, or an extension) and appending changes to the 'CHANGELOG.md' file.
- B. Incorrect.
Incorrect. Merely publishing the file as an artifact won�t automatically update the Git repository. Publishing artifacts makes files available for download or use in subsequent jobs, but does not push changes back.
- C. Correct.
Correct. To commit and push updates from a pipeline, you must enable Git credentials in the pipeline's 'Checkout' step (e.g., 'persistCredentials: true'). Without this setting, the pipeline can�t push changes back to the repo.
- D. Incorrect.
Incorrect. While manual reviews can be helpful, they are not a required automated pipeline task for generating and committing changelog updates.