Skip to content

Commit

Permalink
ci: comment on PR when there are potential conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
PastaPastaPasta committed Apr 14, 2023
1 parent fc43fd1 commit 6ef833f
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions .github/workflows/predict-conflicts.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,5 +24,25 @@ jobs:
uses: PastaPastaPasta/[email protected]
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 }}

0 comments on commit 6ef833f

Please sign in to comment.