Skip to content

Commit fdd0996

Browse files
committed
chore: apply repo-ansible standard and relicense
1 parent 4c06ad2 commit fdd0996

13 files changed

+449
-128
lines changed

Diff for: .github/CODEOWNERS

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
# Code Owners
2+
3+
# The following individuals are designated as code owner(s) for specific files/directories in the repository:
4+
5+
* @mhitza

Diff for: CODE_OF_CONDUCT.md renamed to .github/CODE_OF_CONDUCT.md

+20-30
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,19 @@
1-
# Contributor Covenant Code of Conduct
1+
## TL;DR
2+
<!-- Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -->
3+
4+
Be nice. Provide and accept constructive feedback. Avoid spamming, abusive, trolling, and otherwise unacceptable behavior. Repeat violations may result in a permanent ban.
5+
6+
## Scope
7+
8+
This Code of Conduct applies to all persons, including contributors, maintainers, end users, sponsors, etc., who interact with this project. It applies within all community spaces and also applies when
9+
an individual is officially representing the community in public spaces.
10+
Examples of representing our community include using an official email address,
11+
posting via an official social media account, or acting as an appointed
12+
representative at an online or offline event.
213

314
## Our Pledge
415

5-
We as members, contributors, and leaders pledge to make participation in our
16+
We as contributors, maintainers, end users, and sponsors of this project pledge to make participation in our
617
community a harassment-free experience for everyone, regardless of age, body
718
size, visible or invisible disability, ethnicity, sex characteristics, gender
819
identity and expression, level of experience, education, socio-economic status,
@@ -17,9 +28,9 @@ diverse, inclusive, and healthy community.
1728
Examples of behavior that contributes to a positive environment for our
1829
community include:
1930

20-
* Demonstrating empathy and kindness toward other people
21-
* Being respectful of differing opinions, viewpoints, and experiences
2231
* Giving and gracefully accepting constructive feedback
32+
* Being respectful of differing opinions, viewpoints, and experiences
33+
* Demonstrating empathy and kindness toward other people
2334
* Accepting responsibility and apologizing to those affected by our mistakes,
2435
and learning from the experience
2536
* Focusing on what is best not just for us as individuals, but for the overall
@@ -33,7 +44,8 @@ Examples of unacceptable behavior include:
3344
* Public or private harassment
3445
* Publishing others' private information, such as a physical or email address,
3546
without their explicit permission
36-
* Other conduct which could reasonably be considered inappropriate in a
47+
* Spamming issues, pull requests, or community members
48+
* Other conduct which could reasonably be considered inappropriate or unproductive in a
3749
professional setting
3850

3951
## Enforcement Responsibilities
@@ -48,19 +60,10 @@ comments, commits, code, wiki edits, issues, and other contributions that are
4860
not aligned to this Code of Conduct, and will communicate reasons for moderation
4961
decisions when appropriate.
5062

51-
## Scope
52-
53-
This Code of Conduct applies within all community spaces, and also applies when
54-
an individual is officially representing the community in public spaces.
55-
Examples of representing our community include using an official e-mail address,
56-
posting via an official social media account, or acting as an appointed
57-
representative at an online or offline event.
58-
5963
## Enforcement
6064

6165
Instances of abusive, harassing, or otherwise unacceptable behavior may be
62-
reported to the community leaders responsible for enforcement at
63-
66+
reported to the maintainers or community leaders responsible for enforcement at [[email protected]](mailto:[email protected]).
6467
All complaints will be reviewed and investigated promptly and fairly.
6568

6669
All community leaders are obligated to respect the privacy and security of the
@@ -112,21 +115,8 @@ individual, or aggression toward or disparagement of classes of individuals.
112115
**Consequence**: A permanent ban from any sort of public interaction within the
113116
community.
114117

115-
## Attribution
118+
## Credits
116119

117120
This Code of Conduct is adapted from the [Contributor Covenant][homepage],
118121
version 2.1, available at
119-
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html][v2.1].
120-
121-
Community Impact Guidelines were inspired by
122-
[Mozilla's code of conduct enforcement ladder][Mozilla CoC].
123-
124-
For answers to common questions about this code of conduct, see the FAQ at
125-
[https://www.contributor-covenant.org/faq][FAQ]. Translations are available at
126-
[https://www.contributor-covenant.org/translations][translations].
127-
128-
[homepage]: https://www.contributor-covenant.org
129-
[v2.1]: https://www.contributor-covenant.org/version/2/1/code_of_conduct.html
130-
[Mozilla CoC]: https://github.com/mozilla/diversity
131-
[FAQ]: https://www.contributor-covenant.org/faq
132-
[translations]: https://www.contributor-covenant.org/translations
122+
[https://www.contributor-covenant.org/version/2/1/code_of_conduct.html](https://www.contributor-covenant.org/version/2/1/code_of_conduct.html).

Diff for: .github/SECURITY.md

+24
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<!-- Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten. -->
2+
commit-message-checker
3+
============
4+
5+
### Reporting Security Vulnerabilities
6+
We take the security of our software and systems very seriously, and we appreciate your help in identifying and disclosing any vulnerabilities that you may find.
7+
8+
If you discover a security vulnerability, please report it to us as soon as possible by emailing us at [email protected]. Please do not disclose the vulnerability publicly until we have had a chance to investigate and address it. Please provide us with as much detail as possible, including:
9+
10+
* A detailed description of the vulnerability.
11+
* Steps to reproduce the vulnerability.
12+
* Any relevant screenshots, logs, or other supporting information.
13+
* We will review your report as quickly as possible and will work to validate and address the issue.
14+
* Your name and contact information (if you wish to be credited for the discovery)
15+
16+
### Our Security Practices
17+
* Regularly updating dependencies and libraries to address known security vulnerabilities
18+
* Conducting regular security audits and code reviews
19+
* Implementing secure coding practices and using secure development tools
20+
* Keeping sensitive data (such as API keys or credentials) encrypted and protected
21+
* Providing timely security updates and patches to address known vulnerabilities
22+
23+
### Responsible Disclosure
24+
We believe in responsible disclosure, and we ask that you do not disclose any details of a vulnerability that you have discovered until we have had a reasonable amount of time to address it. We will notify users of known vulnerabilities and the steps they should take to address them promptly. We will also publish a public advisory on our website and other relevant channels once a vulnerability has been confirmed and addressed.

Diff for: .github/settings.yml

+75
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
# Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten.
2+
# These settings are synced to GitHub by https://probot.github.io/apps/settings/
3+
# See https://docs.github.com/en/rest/reference/repos#update-a-repository for all available settings.
4+
5+
repository:
6+
7+
# The name of the repository. Changing this will rename the repository
8+
name: commit-message-checker
9+
10+
# A short description of the repository that will show up on GitHub
11+
description: "Forked for maintenance. GitHub Action to check commit messages against a regex pattern.
12+
"
13+
14+
15+
# A URL with more information about the repository
16+
homepage: https://engineering.linkorb.com
17+
18+
19+
# Either `true` to make the repository private, or `false` to make it public.
20+
private: true
21+
22+
has_issues: false
23+
24+
# Either `true` to enable projects for this repository, or `false` to disable them.
25+
# If projects are disabled for the organization, passing `true` will cause an API error.
26+
has_projects: false
27+
28+
has_wiki: false
29+
30+
# Either `true` to enable downloads for this repository, `false` to disable them.
31+
has_downloads: true
32+
33+
# Updates the default branch for this repository.
34+
default_branch: fork
35+
36+
# Either `true` to allow squash-merging pull requests, or `false` to prevent
37+
# squash-merging.
38+
allow_squash_merge: true
39+
40+
# Either `true` to allow merging pull requests with a merge commit, or `false`
41+
# to prevent merging pull requests with merge commits.
42+
allow_merge_commit: true
43+
44+
# Either `true` to allow rebase-merging pull requests, or `false` to prevent
45+
# rebase-merging.
46+
allow_rebase_merge: true
47+
48+
# Either `true` to enable automatic deletion of branches on merge, or `false` to disable
49+
delete_branch_on_merge: true
50+
51+
# Either `true` to enable automated security fixes, or `false` to disable
52+
# automated security fixes.
53+
enable_automated_security_fixes: true
54+
55+
# Either `true` to enable vulnerability alerts, or `false` to disable
56+
# vulnerability alerts.
57+
enable_vulnerability_alerts: true
58+
59+
# Labels: define labels for Issues and Pull Requests
60+
labels:
61+
- name: fix
62+
color: CC0000
63+
description: An issue with the system.
64+
65+
- name: feat
66+
# If including a `#`, make sure to wrap it with quotes!
67+
color: '#336699'
68+
description: New feature.
69+
70+
- name: chore
71+
color: CC0000
72+
description: A repository chore.
73+
74+
75+
# Milestones: define milestones for Issues and Pull Requests

Diff for: .github/workflows/10-review.yaml

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Managed by https://github.com/linkorb/repo-ansible. Manual changes will be overwritten.
2+
name: Review
3+
4+
on:
5+
pull_request_target:
6+
types: [opened, edited, reopened, synchronize]
7+
workflow_call:
8+
9+
jobs:
10+
commit-conventions:
11+
runs-on: ubuntu-latest
12+
# Don't enforce commit conventions checks for Dependabot
13+
if: github.actor != 'dependabot[bot]'
14+
steps:
15+
- name: Checkout
16+
uses: actions/checkout@v4
17+
18+
# interesting alternative: https://github.com/cocogitto/cocogitto
19+
- name: Conventional commit checker
20+
uses: webiny/[email protected]
21+
# XXX: normal action versioning syntax (`@v1`) doesn't work with this action,
22+
# possibly because not published on the GitHub marketplace
23+
24+
- name: Check Card# reference
25+
uses: gsactions/commit-message-checker@v2
26+
with:
27+
# Matches lines that end in a card number: #1234
28+
# Matches lines that end in a card number and PR reference: #1234 (#20)
29+
pattern: '#\d{4}(\s+\(#\d+\))?'
30+
flags: 'gm'
31+
error: 'Your commit message has to end with a card number like "#1234".'
32+
excludeDescription: 'true' # optional: this excludes the description body of a pull request
33+
excludeTitle: 'true' # optional: this excludes the title of a pull request
34+
checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request
35+
accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true
36+
37+
- name: Check Line Length
38+
uses: gsactions/commit-message-checker@v2
39+
with:
40+
pattern: '^.{0,50}$'
41+
error: 'The maximum line length of 50 characters is exceeded.'
42+
excludeDescription: 'true' # optional: this excludes the description body of a pull request
43+
excludeTitle: 'true' # optional: this excludes the title of a pull request
44+
checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request
45+
accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true
46+
47+
- name: Check Body Length
48+
uses: gsactions/commit-message-checker@v2
49+
with:
50+
pattern: '^.{0,72}$'
51+
error: 'The maximum line length of 72 characters is exceeded in the body.'
52+
excludeDescription: 'false' # optional: this excludes the description body of a pull request
53+
excludeTitle: 'true' # optional: this excludes the title of a pull request
54+
checkAllCommitMessages: 'true' # optional: this checks all commits associated with a pull request
55+
accessToken: ${{ secrets.GITHUB_TOKEN }} # github access token is only required if checkAllCommitMessages is true

Diff for: .github/workflows/dependabot-auto-merge.yaml

+22
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: Auto-merge Dependabot PRs
2+
on: pull_request_target
3+
4+
permissions:
5+
pull-requests: write # required for the action to read metadata
6+
contents: write # required for the gh client to read/merge commits
7+
8+
jobs:
9+
run:
10+
runs-on: ubuntu-latest
11+
if: ${{ github.event.pull_request.user.login == 'dependabot[bot]' }}
12+
steps:
13+
- name: Dependabot metadata
14+
id: metadata
15+
uses: dependabot/fetch-metadata@v2
16+
17+
- name: Enable auto-merge for Dependabot PRs
18+
if: steps.metadata.outputs.update-type == 'version-update:semver-minor' || steps.metadata.outputs.update-type == 'version-update:semver-patch'
19+
run: gh pr merge --merge "$PR_URL"
20+
env:
21+
PR_URL: ${{ github.event.pull_request.html_url }}
22+
GH_TOKEN: ${{ github.token }}

Diff for: .github/workflows/repo-ansible.yaml

+79
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
name: Auto-run repo-ansible
2+
3+
on:
4+
workflow_dispatch:
5+
6+
pull_request_target:
7+
paths:
8+
- 'repo.yaml'
9+
push:
10+
branches:
11+
- main
12+
- master
13+
paths:
14+
- 'repo.yaml'
15+
16+
permissions:
17+
contents: write # allow git commits & push
18+
pull-requests: write # allow comments on PR
19+
20+
env:
21+
# XXX alternative to missing ternary syntax
22+
IS_PULL_REQUEST: ${{ github.event_name == 'pull_request_target' && '1' || '0' }}
23+
24+
jobs:
25+
run:
26+
runs-on: ubuntu-latest
27+
steps:
28+
- if: ${{ env.IS_PULL_REQUEST == '0' }}
29+
uses: actions/checkout@v4
30+
31+
- if: ${{ env.IS_PULL_REQUEST == '1' }}
32+
uses: actions/checkout@v4
33+
with:
34+
ref: refs/pull/${{ github.event.pull_request.number }}/merge
35+
36+
- name: repo-ansible
37+
run: |
38+
docker pull ghcr.io/linkorb/repo-ansible:latest >/dev/null
39+
docker run --rm -v "$PWD":/app ghcr.io/linkorb/repo-ansible:latest | tee /tmp/repo_ansible_output
40+
export OUTPUT=$(cat /tmp/repo_ansible_output)
41+
{
42+
echo 'REPO_ANSIBLE_OUTPUT<<EOF'
43+
echo "$OUTPUT"
44+
echo EOF
45+
} >> "$GITHUB_ENV"
46+
47+
if ! echo "$OUTPUT" | grep "changed=0"; then
48+
echo "REPOSITORY_CHANGED=1" >> "$GITHUB_ENV"
49+
fi
50+
51+
52+
- if: ${{ env.IS_PULL_REQUEST == '0' }}
53+
name: commit changes
54+
run: |
55+
git config user.name "github-actions[bot]"
56+
git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
57+
git add .
58+
if git commit -m "chore: automatic repo-ansible run #0000"; then
59+
git push
60+
fi
61+
62+
63+
- if: ${{ env.IS_PULL_REQUEST == '1' && env.REPOSITORY_CHANGED == '1' }}
64+
name: comment with changes
65+
uses: actions/github-script@v7
66+
with:
67+
script: |
68+
const changes = process.env.REPO_ANSIBLE_OUTPUT
69+
github.rest.issues.createComment({
70+
issue_number: context.issue.number,
71+
owner: context.repo.owner,
72+
repo: context.repo.repo,
73+
body: `Following repo-ansible changes will be applied when merged to main/master branch
74+
75+
\`\`\`shell
76+
${changes}
77+
\`\`\`
78+
`
79+
})

0 commit comments

Comments
 (0)