diff --git a/.github/workflows/dco-welcome.yml b/.github/workflows/dco-welcome.yml index 48481d6f..cada1f8f 100644 --- a/.github/workflows/dco-welcome.yml +++ b/.github/workflows/dco-welcome.yml @@ -6,52 +6,5 @@ on: jobs: dco-help: - runs-on: ubuntu-latest - permissions: - contents: read - issues: write - pull-requests: write - if: | - github.event.check_run.conclusion == 'failure' && - contains(github.event.check_run.name, 'DCO') && - github.event.check_run.pull_requests[0] != null - steps: - - name: Load PR Context - id: pr-context - uses: actions/github-script@v7 - with: - script: | - const prs = context.payload.check_run.pull_requests || []; - if (prs.length === 0) { - core.setOutput('should_comment', 'false'); - return; - } - - const prNumber = prs[0].number; - const { data: pr } = await github.rest.pulls.get({ - owner: context.repo.owner, - repo: context.repo.repo, - pull_number: prNumber, - }); - - const shouldComment = ['FIRST_TIME_CONTRIBUTOR', 'NONE'].includes(pr.author_association); - core.setOutput('pr_number', String(prNumber)); - core.setOutput('should_comment', shouldComment ? 'true' : 'false'); - - - name: Post DCO Instructions - if: steps.pr-context.outputs.should_comment == 'true' - uses: peter-evans/create-or-update-comment@v3 - with: - issue-number: ${{ steps.pr-context.outputs.pr_number }} - body: | - Welcome to the project, @${{ github.actor }}! - - It looks like this is your first contribution. We noticed the **DCO (Developer Certificate of Origin)** check might fail if your commits aren't signed. - - To fix this, please ensure every commit has a `Signed-off-by: Name ` line. You can do this automatically by using the `-s` flag: - `git commit -s -m "Your message"` - - For existing commits, you can fix them with: - `git commit --amend --signoff` or `git rebase -i HEAD~N --signoff` (where N is the number of commits) - The Developer Community DCO guide also provides helpful tips on fixing DCO inconveniences. Setting a commit hook in the git repository will automate adding the DCO signoff. - See https://github.com/p4lang/governance/wiki/P4-DCO-Guidelines for information. + # https://github.com/p4lang/.github/blob/main/.github/workflows/dco-welcome-reusable.yml + uses: p4lang/.github/.github/workflows/dco-welcome-reusable.yml@main \ No newline at end of file