diff --git a/.github/workflows/pr-comment-api-change.md b/.github/workflows/pr-comment-api-change.md new file mode 100644 index 000000000..62b2d2076 --- /dev/null +++ b/.github/workflows/pr-comment-api-change.md @@ -0,0 +1,15 @@ +This PR changes files in the API project. Does it change _any_ of the API interfaces in _any way_? Please note that this includes the following types of changes: +- Changing the signature of an existing interface method +- Adding a new method to an existing interface +- Adding a required data member to a class that an existing interface method consumes + +Because any of these changes can potentially break a downstream consumer with customized interface implementations, these changes need to be treated as breaking changes. Please do one of the following: + +## Option 1 - Publish this as a breaking change +1. Update the documentation to show the new functionality and/or explain the change +2. Bump the major version in the next release + +## Option 2 - Refactor the changes to be non-breaking +1. Review [this commit](https://github.com/microsoft/sbom-tool/commit/4d0ce83e194ed6feace53666aeb6280f5b8b8769), which adds a new interface in a backward-compatible way +2. Refactor the change to follow this pattern so that existing interfaces are left completely intact +3. Bump the minor version in the next release diff --git a/.github/workflows/pr-comment-api-change.yml b/.github/workflows/pr-comment-api-change.yml new file mode 100644 index 000000000..e17b55115 --- /dev/null +++ b/.github/workflows/pr-comment-api-change.yml @@ -0,0 +1,22 @@ +name: Check for API changes + +on: + pull_request: + paths: + - 'src/Microsoft.Sbom.Api/**/*.cs' + +jobs: + auto-comment: + runs-on: ubuntu-latest + permissions: + pull-requests: write + steps: + - name: Checkout Repository + uses: actions/checkout@v4 + - name: PR Comment + run: + gh pr comment $PRNUM --body-file .github/workflows/pr-comment-api-change.md + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + GH_REPO: ${{ github.repository }} + PRNUM: ${{ github.event.pull_request.number }} \ No newline at end of file diff --git a/src/Microsoft.Sbom.Api/SBOMGenerator.cs b/src/Microsoft.Sbom.Api/SBOMGenerator.cs index 06c9d259a..e1bed5860 100644 --- a/src/Microsoft.Sbom.Api/SBOMGenerator.cs +++ b/src/Microsoft.Sbom.Api/SBOMGenerator.cs @@ -22,6 +22,7 @@ namespace Microsoft.Sbom.Api; /// /// Responsible for an API to generate SBOMs. +/// This is a dummy comment to test the PR workflow /// public class SbomGenerator : ISBOMGenerator {