Repository navigation
ci(dco): add a reusable DCO sign-off workflow and have Renovate sign off #405
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| name: Reusable — DCO sign-off | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| runner: | ||
| description: 'Override the runner label. Empty (default) auto-selects by repo visibility: private repos use ferrlabs-k8s-light, public repos use ubuntu-latest.' | ||
| type: string | ||
| required: false | ||
| default: '' | ||
|
|
||
| concurrency: | ||
| group: reusable-dco-${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| sign-off: | ||
| name: sign-off | ||
| runs-on: ${{ inputs.runner != '' && inputs.runner || (github.event.repository.private && 'ferrlabs-k8s-light' || 'ubuntu-latest') }} | ||
| steps: | ||
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 | ||
| with: | ||
| fetch-depth: 0 | ||
| persist-credentials: false | ||
| - name: Every commit needs a Signed-off-by line | ||
| env: | ||
| BASE_REF: ${{ github.base_ref }} | ||
| HEAD_SHA: ${{ github.event.pull_request.head.sha }} | ||
| run: | | ||
| missing=$(git log --no-merges --format='%H %s' --invert-grep --grep='^Signed-off-by: ' \ | ||
| "origin/${BASE_REF}..${HEAD_SHA}") | ||
| if [ -n "$missing" ]; then | ||
| echo "Commits without a sign-off:" | ||
| echo "$missing" | ||
| echo "Run: git rebase --signoff origin/${BASE_REF}" | ||
| exit 1 | ||
| fi | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,7 @@ | ||
| { | ||
| "name": "FerrLabs — DCO sign-off", | ||
| "description": "Fails a PR when one of its commits has no Signed-off-by line. Fix with git rebase --signoff.", | ||
| "iconName": "ferrlabs", | ||
| "categories": ["Continuous integration"], | ||
| "filePatterns": [".*"] | ||
| } |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,12 @@ | ||
| name: DCO | ||
|
|
||
| on: | ||
| pull_request: | ||
| types: [opened, edited, synchronize, reopened] | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| sign-off: | ||
| uses: FerrLabs/.github/.github/workflows/reusable-dco.yml@main | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit:
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Not changed here: the SHA only exists once this merges. I'll pin the template (and the callers rolled out to other repos) to the merge commit in a follow-up. |
||
Uh oh!
There was an error while loading. Please reload this page.