DCO #3
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: DCO | |
| on: | |
| pull_request_target: | |
| branches: | |
| - main | |
| - master | |
| - 'release/**' | |
| permissions: | |
| pull-requests: read | |
| statuses: write | |
| jobs: | |
| check: | |
| name: DCO Check | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check if PR is from Copilot | |
| id: check-copilot | |
| run: | | |
| if [[ "${{ github.event.pull_request.user.login }}" == "github-actions[bot]" ]] || \ | |
| [[ "${{ github.event.pull_request.user.login }}" == "copilot-for-prs[bot]" ]] || \ | |
| [[ "${{ github.head_ref }}" == "copilot/"* ]]; then | |
| echo "is_copilot=true" >> $GITHUB_OUTPUT | |
| else | |
| echo "is_copilot=false" >> $GITHUB_OUTPUT | |
| fi | |
| - name: Skip DCO for Copilot PRs | |
| if: steps.check-copilot.outputs.is_copilot == 'true' | |
| run: | | |
| echo "Skipping DCO check for Copilot-generated PR" | |
| echo "Copilot commits are automatically trusted" | |
| exit 0 | |
| - name: Get PR Commits | |
| if: steps.check-copilot.outputs.is_copilot == 'false' | |
| id: 'get-pr-commits' | |
| uses: tim-actions/[email protected] | |
| with: | |
| token: ${{ secrets.GITHUB_TOKEN }} | |
| - name: DCO Check | |
| if: steps.check-copilot.outputs.is_copilot == 'false' | |
| uses: tim-actions/[email protected] | |
| with: | |
| commits: ${{ steps.get-pr-commits.outputs.commits }} |