From 6ef833f7898be3ad2af77562ec55d03abc1576d7 Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 14 Apr 2023 15:43:39 -0500 Subject: [PATCH 1/4] ci: comment on PR when there are potential conflicts --- .github/workflows/predict-conflicts.yml | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/.github/workflows/predict-conflicts.yml b/.github/workflows/predict-conflicts.yml index 45969660b0cc..192fe18a02e3 100644 --- a/.github/workflows/predict-conflicts.yml +++ b/.github/workflows/predict-conflicts.yml @@ -24,5 +24,25 @@ jobs: uses: PastaPastaPasta/potential-conflicts-checker-action@0.1.9 with: ghToken: "${{ secrets.GITHUB_TOKEN }}" + id: conflicts-check + - name: validate potential conflicts run: wget https://raw.githubusercontent.com/dashpay/dash/develop/.github/workflows/handle_potential_conflicts.py && pip3 install hjson && python3 handle_potential_conflicts.py "$conflicts" + env: + conflicts: ${{ steps.conflicts-check.output }} + + - name: comment on PR if there are conflicting PRs + if: steps.conflicts-check.outputs.conflictingPrs != '' + uses: actions/github-script@v5 + with: + script: | + const prNumber = context.payload.pull_request.number; + const conflictingPrs = `${{ steps.conflicts-check.outputs.conflictingPrs }}`; + const comment = `Conflicting PRs: ${conflictingPrs}`; + await github.rest.issues.createComment({ + owner: context.repo.owner, + repo: context.repo.repo, + issue_number: prNumber, + body: comment, + }); + github-token: ${{ secrets.GITHUB_TOKEN }} From 5241ff12e407192a4f80947d35813b716d7dd85d Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 14 Apr 2023 16:24:17 -0500 Subject: [PATCH 2/4] test? --- .github/workflows/predict-conflicts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/predict-conflicts.yml b/.github/workflows/predict-conflicts.yml index 192fe18a02e3..62c34895e25e 100644 --- a/.github/workflows/predict-conflicts.yml +++ b/.github/workflows/predict-conflicts.yml @@ -27,9 +27,9 @@ jobs: id: conflicts-check - name: validate potential conflicts - run: wget https://raw.githubusercontent.com/dashpay/dash/develop/.github/workflows/handle_potential_conflicts.py && pip3 install hjson && python3 handle_potential_conflicts.py "$conflicts" + run: echo $test && echo $conflicts && wget https://raw.githubusercontent.com/dashpay/dash/develop/.github/workflows/handle_potential_conflicts.py && pip3 install hjson && python3 handle_potential_conflicts.py "$conflicts" env: - conflicts: ${{ steps.conflicts-check.output }} + conflicts: ${{ steps.conflicts-check.outputs.conflicts }} - name: comment on PR if there are conflicting PRs if: steps.conflicts-check.outputs.conflictingPrs != '' From 5bdcde4647d11f015781e51c8bdf3b5f32fa1c00 Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 14 Apr 2023 16:37:11 -0500 Subject: [PATCH 3/4] test? --- .github/workflows/predict-conflicts.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/predict-conflicts.yml b/.github/workflows/predict-conflicts.yml index 62c34895e25e..a9b5ef927a7c 100644 --- a/.github/workflows/predict-conflicts.yml +++ b/.github/workflows/predict-conflicts.yml @@ -28,8 +28,8 @@ jobs: - name: validate potential conflicts run: echo $test && echo $conflicts && wget https://raw.githubusercontent.com/dashpay/dash/develop/.github/workflows/handle_potential_conflicts.py && pip3 install hjson && python3 handle_potential_conflicts.py "$conflicts" - env: - conflicts: ${{ steps.conflicts-check.outputs.conflicts }} +# env: +# conflicts: ${{ steps.conflicts-check.outputs.conflicts }} - name: comment on PR if there are conflicting PRs if: steps.conflicts-check.outputs.conflictingPrs != '' From 6625ebfb7ef0425519dc2b689aa81f637eee6626 Mon Sep 17 00:00:00 2001 From: pasta Date: Fri, 14 Apr 2023 15:51:28 -0500 Subject: [PATCH 4/4] ci: should cause failures --- conflict | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 conflict diff --git a/conflict b/conflict new file mode 100644 index 000000000000..760a73a35571 --- /dev/null +++ b/conflict @@ -0,0 +1,2 @@ +A +