From 1cfe81d6aa5288f4397db3c3d7f1d30883201cbc Mon Sep 17 00:00:00 2001 From: Shad Storhaug Date: Tue, 18 Oct 2022 22:53:00 +0700 Subject: [PATCH] .github/workflows: Added Lucene-Net-Dependency-Conflict-Warning.yml to post a message to post a reminder comment to a PR to run the tests in Azure DevOps if it contains changes to dependences.props or any .csproj file. --- ...Lucene-Net-Dependency-Conflict-Warning.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/Lucene-Net-Dependency-Conflict-Warning.yml diff --git a/.github/workflows/Lucene-Net-Dependency-Conflict-Warning.yml b/.github/workflows/Lucene-Net-Dependency-Conflict-Warning.yml new file mode 100644 index 0000000000..d8da6c9ddd --- /dev/null +++ b/.github/workflows/Lucene-Net-Dependency-Conflict-Warning.yml @@ -0,0 +1,45 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you under the Apache License, Version 2.0 (the +# "License"); you may not use this file except in compliance +# with the License. You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, +# software distributed under the License is distributed on an +# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +# KIND, either express or implied. See the License for the +# specific language governing permissions and limitations +# under the License. + +# References: +# https://stackoverflow.com/a/58704739 +# https://docs.github.com/en/actions/security-guides/automatic-token-authentication + +name: 'Lucene.Net Dependency Conflict Warning' + +on: + pull_request: + paths: + - '.build/dependencies.props' + - 'src/**/*.csproj' + +jobs: + + comment: + runs-on: ubuntu-latest + steps: + - name: Add warning comment to PR + env: + URL: ${{ github.event.pull_request.comments_url }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + curl \ + -X POST \ + $URL \ + -H "Content-Type: application/json" \ + -H "Authorization: token $GITHUB_TOKEN" \ + --data '{ "body": ":warning: **IMPORTANT:** This PR may contain changes to dependency versions. The GitHub Actions test runner is not set up to detect dependency version conflicts between projects. To ensure the changes do not cause dependency conflicts, [run the tests for these changes in Azure DevOps](https://github.com/apache/lucenenet#azure-devops) before accepting this pull request. :warning:" }'