dynamo/.github/workflows/dco_comment.yml

40 lines
1.3 KiB
YAML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

name: DCO Commenter
on:
pull_request:
types: [opened, synchronize, reopened]
permissions:
issues: write
checks: read
jobs:
dco-comment:
runs-on: ubuntu-latest
steps:
- name: Get DCO status
id: dco
uses: actions/github-script@v7
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
const { data: checks } = await github.rest.checks.listForRef({
owner: context.repo.owner,
repo: context.repo.repo,
ref: context.payload.pull_request.head.sha,
});
const dco = checks.check_runs.find(run => run.name === "DCO");
core.setOutput("conclusion", dco ? dco.conclusion : "not_found");
- name: Comment if DCO failed (deduped)
if: steps.dco.outputs.conclusion == 'failure'
uses: peter-evans/create-or-update-comment@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
issue-number: ${{ github.event.pull_request.number }}
body: |
⚠️ Your pull request failed the DCO check.
Dont worry! Check out our [DCO Troubleshooting Guide](https://github.com/ai-dynamo/dynamo/blob/main/DCO.md) for step-by-step instructions to fix it quickly.
edit-mode: replace