Skip to content

Commit c9d2bcc

Browse files
author
Bill Berry
committed
feat(build): add CLA section and Dependabot security prefix workflow
- Add Contributor License Agreement section to root CONTRIBUTING.md - Add workflow to retitle Dependabot security PRs with security(deps) prefix Closes #236, Closes #237 📝 - Generated by Copilot
1 parent a78cb97 commit c9d2bcc

2 files changed

Lines changed: 48 additions & 0 deletions

File tree

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: Dependabot Security Prefix
2+
3+
on:
4+
pull_request:
5+
types:
6+
- opened
7+
8+
permissions:
9+
contents: read
10+
pull-requests: write
11+
12+
jobs:
13+
retitle-security-pr:
14+
name: Retitle Security PRs
15+
runs-on: ubuntu-latest
16+
if: github.actor == 'dependabot[bot]'
17+
permissions:
18+
contents: read
19+
pull-requests: write
20+
21+
steps:
22+
- name: Fetch Dependabot metadata
23+
id: metadata
24+
uses: dependabot/fetch-metadata@21025c705c08248db411dc16f3619e6b5f9ea21a # v2.5.0
25+
with:
26+
github-token: "${{ secrets.GITHUB_TOKEN }}"
27+
28+
- name: Retitle PR with security prefix
29+
if: steps.metadata.outputs.ghsa-id != '' || steps.metadata.outputs.cvss != ''
30+
env:
31+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
32+
PR_NUMBER: ${{ github.event.pull_request.number }}
33+
PR_TITLE: ${{ github.event.pull_request.title }}
34+
run: |
35+
new_title="${PR_TITLE/chore(deps)/security(deps)}"
36+
new_title="${new_title/chore(deps-dev)/security(deps-dev)}"
37+
if [[ "${new_title}" != "${PR_TITLE}" ]]; then
38+
gh pr edit "${PR_NUMBER}" --repo "${GITHUB_REPOSITORY}" --title "${new_title}"
39+
echo "Retitled PR #${PR_NUMBER}: ${new_title}"
40+
fi

CONTRIBUTING.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,14 @@ Contributions are welcome across infrastructure code, deployment automation, doc
1515

1616
If you are new to the project, start with issues labeled `good first issue` or documentation updates before making larger changes.
1717

18+
## Contributor License Agreement
19+
20+
Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit <https://cla.opensource.microsoft.com>.
21+
22+
When you submit a pull request, a CLA bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., status check, comment). Follow the instructions provided by the bot. You only need to do this once across all repos using our CLA.
23+
24+
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com) with any questions or comments.
25+
1826
## Getting Started
1927

2028
1. Read the [Contributing Guide](docs/contributing/README.md) for prerequisites, workflow, and conventions

0 commit comments

Comments
 (0)