Skip to content

Commit ffd84d9

Browse files
authored
Merge pull request #2 from spier/adding-new-feature-owner-pattern
Fix warnings from GHA checks
2 parents d7e9180 + 92e13ac commit ffd84d9

File tree

65 files changed

+831
-211
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

65 files changed

+831
-211
lines changed

.github/ISSUE_TEMPLATE/config.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
blank_issues_enabled: true
22
contact_links:
33
- name: Slack
4-
url: https://innersourcecommons-inviter.herokuapp.com
4+
url: https://innersourcecommons.org/slack
55
about: Join our Community on Slack for help and a casual chat.
66
- name: Patterns Book
77
url: https://patterns.innersourcecommons.org

.github/config.yml

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
# Configuration for welcome - https://github.com/behaviorbot/welcome
2+
3+
# Configuration for new-issue-welcome - https://github.com/behaviorbot/new-issue-welcome
4+
5+
# Comment to be posted to on first time issues
6+
newIssueWelcomeComment: >
7+
[![Welcome Banner](https://zenodo.org/api/iiif/v2/0c0188d3-d03c-4830-a6e3-00405f5c22fa:8ff47a85-7250-4d86-8e48-2f346b48b2c1:BannerWelcome.jpg/full/750,/0/default.jpg)](https://zenodo.org/record/3695300)
8+
9+
:tada: Welcome to _The InnerSource Commons_ community, and in particular to our patterns! :tada:
10+
We're really excited to have your input into the project! :sparkling_heart:
11+
12+
<br>If you haven't done so already, please check out our [Contributing Guidelines](https://github.com/InnerSourceCommons/InnerSourcePatterns/blob/main/CONTRIBUTING.md).
13+
If you need to connect more synchronously with members of _The InnerSource Commons_ community, come chat with us in our [Slack workspace](https://innersourcecommons.org/slack).
14+
15+
# Configuration for new-pr-welcome - https://github.com/behaviorbot/new-pr-welcome
16+
17+
# Comment to be posted to on PRs from first time contributors in your repository
18+
newPRWelcomeComment: >
19+
[![Thank You Banner](https://zenodo.org/api/iiif/v2/0c0188d3-d03c-4830-a6e3-00405f5c22fa:7fbd97cf-283b-480c-b8e1-11866e26245c:BannerThanks.jpg/full/750,/0/default.jpg)](https://zenodo.org/record/3695300)
20+
21+
:sparkling_heart: Thanks for opening this pull request! :sparkling_heart:
22+
_The InnerSource Commons_ community really appreciates your time and effort to contribute to the project.
23+
Please make sure you have read our [Contributing Guidelines](https://github.com/InnerSourceCommons/InnerSourcePatterns/blob/main/CONTRIBUTING.md).
24+
25+
If you are submitting a new pattern, the following things will help get your pull request across the finish line! :checkered_flag:
26+
27+
- Check you have used our [pattern template](https://github.com/InnerSourceCommons/InnerSourcePatterns/blob/main/meta/pattern-template.md) and removed any placeholder text and sections that your pattern did not need.
28+
29+
- We will run a number of automated checks on your PR. Please review the output of those checks on the PR itself, and see if any issues got flagged that you can fix yourself.
30+
31+
- Make sure you have added your new pattern to the list of patterns in the main [README.md](https://github.com/InnerSourceCommons/InnerSourcePatterns/blob/main/README.md). If you are unsure where to add your pattern, no worries. Just let us know on the PR and we will help you.
32+
33+
<br>This project has a small number of maintainers, volunteering their time to this project. So please be patient and we will get back to you as soon as we can.
34+
If we don't acknowledge this pull request after 7 days, feel free to chat to us about it in our [Slack workspace](https://innersourcecommons.org/slack).
35+
36+
# Configuration for first-pr-merge - https://github.com/behaviorbot/first-pr-merge
37+
38+
# Comment to be posted to on pull requests merged by a first time user
39+
firstPRMergeComment: >
40+
[![Congratulations Banner](https://zenodo.org/api/iiif/v2/0c0188d3-d03c-4830-a6e3-00405f5c22fa:32fbdb89-ae1b-434e-830c-88ade86724cc:BannerCongratulations.jpg/full/750,/0/default.jpg)](https://zenodo.org/record/3695300)
41+
42+
Congrats on merging your first pull request! :tada:
43+
We here at _The InnerSource Commons_ are proud of you! :sparkling_heart:
44+
Thank you so much for your contribution :gift:

.github/vale/Vocab/Base/accept.txt

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
Manoj
2+
Gawande
3+
Dinesh
4+
Ramadoss
5+
Amit
6+
Chauhan

.github/vale/Vocab/Base/reject.txt

Whitespace-only changes.
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
name: i18n check consistency and notify on GitHub Issues
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
paths:
8+
- .github/workflows/i18n-consistency-check.yml
9+
schedule:
10+
- cron: '0 0 1 * *'
11+
workflow_dispatch:
12+
13+
jobs:
14+
consistency-check:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
matrix:
18+
language: [ja, zh]
19+
steps:
20+
- uses: actions/checkout@v2
21+
with:
22+
fetch-depth: '0'
23+
- name: Check consistency
24+
id: check-consistency
25+
run: |
26+
# Set the issue header
27+
issue="\
28+
# i18n Contents Consistency Issue\\n\
29+
\\n\
30+
The following files may have consistency issues with the English version. Please check and update the files.\\n\
31+
\\n\
32+
This issue is created when there is an update to content/en. It compares the git update history to let you know what updates are overdue. The issue should be closed when the update is complete.\\n"
33+
34+
for file in $(find patterns/2-structured -name '*.md'); do
35+
36+
# Get the translated file name and check if it exists
37+
i18n_filename=$(echo "$file" | sed 's/patterns\/2-structured/translation\/${{matrix.language}}\/patterns/g')
38+
if [[ ! -e "$i18n_filename" ]]; then
39+
continue
40+
fi
41+
echo $file
42+
echo $i18n_filename
43+
# Loop through all the files in the English directory
44+
# Get the last updated date of the original file and the translated file
45+
original_updated_at=$(date -d "$(git log -1 --format=%cd --date=iso $file)" +%s)
46+
i18n_content_updated_at=$(date -d "$(git log -1 --format=%cd --date=iso $i18n_filename)" +%s)
47+
48+
# print the last updated date of the original file and the translated file
49+
50+
# Check if the translated file is updated after the original file
51+
if [[ $(($original_updated_at - $i18n_content_updated_at)) -ge 1 ]]; then
52+
# Get the title of the content
53+
content_header=$(echo "$(cat "$file")" | grep -E '^title+' | sort -r | head -n1)
54+
content_title=$(echo "$content_header" | sed 's/title: //g')
55+
56+
# Get the days since the translated file is overdue
57+
days_since_overdue_updates=$(($(( $(date +%s) - $original_updated_at))/ 60 / 60 / 24))
58+
# Get the diff between the original file and the translated file
59+
original_last_update_hash=$(git log -1 --format=%H $file)
60+
# Get the parent hash of the original last update hash
61+
parent_hash=$(git log -1 --format=%P $original_last_update_hash)
62+
# Get the diff between the original file and the translated file
63+
64+
result=$(echo "$(git diff ${parent_hash} HEAD $file)" | sed '1,4 s/^/# /')
65+
echo -e "$result"
66+
67+
# Add the contents to the issue.md file
68+
issue+="<details><summary><b>$content_title</b> ($file)</summary>\\n\\n"
69+
issue+="- Original File(en): [$file](https://github.com/$GITHUB_REPOSITORY/blob/master/$file)\\n"
70+
issue+="- Translated File(${{matrix.language}}): [$i18n_filename](https://github.com/$GITHUB_REPOSITORY/blob/master/$i18n_filename)\\n"
71+
issue+="- [Diff on GitHub](https://github.com/yuhattor/innersourcecommons.org/compare/$i18n_last_update_hash...$original_last_update_hash)\\n"
72+
issue+="- Days since overdue updates: $days_since_overdue_updates days\\n"
73+
issue+="\`\`\`diff\\n"
74+
issue+="$result"
75+
issue+="\\n\`\`\`\\n"
76+
issue+="</details>\\n"
77+
echo -e "$issue" >> issue.md
78+
issue=""
79+
fi
80+
done
81+
- name: Create Issue
82+
run: |
83+
# Declare the flags
84+
declare -A flags=(
85+
["ja"]="🇯🇵 Japanese"
86+
["zh"]="🇨🇳 Chinese"
87+
)
88+
89+
# Set the issue title
90+
issue_title="${flags[${{matrix.language}}]}: Content Consistency Issue"
91+
92+
# Get the existing issue ID
93+
existing_issue_id=$(gh issue list -S "state:open type:issue title:$issue_title" | cut -f1)
94+
95+
# If the issue.md file exists, create a new issue or comment on the existing issue
96+
if [ -f issue.md ]; then
97+
if expr "$existing_issue_id" : '^[0-9]*$' >/dev/null; then
98+
gh issue comment "$existing_issue_id" -F issue.md -R $GITHUB_REPOSITORY
99+
else
100+
gh issue create -t "$issue_title" -F issue.md -R $GITHUB_REPOSITORY -l "Type - Translation"
101+
fi
102+
fi
103+
env:
104+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/lint-patterns.yml

+5-3
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
# from: https://github.com/marketplace/actions/markdown-linting-action
2+
# To test this locally, switch to the root of the repo and run:
3+
# markdownlint -r config/lint/pattern-template.js -c config/lint/pattern-template.yml patterns/2-structured/*.md patterns/2-structured/project-setup/*.md patterns/3-validated/*.md
24
name: Pattern Syntax Validation
35

46
on:
@@ -8,7 +10,7 @@ on:
810
pull_request:
911
paths:
1012
- ".github/workflows/lint-patterns.yml"
11-
- "lint/*"
13+
- ".github/lint-pattern-syntax/*"
1214
- "patterns/2-structured/*.md"
1315
- "patterns/2-structured/project-setup/*.md"
1416
- "patterns/3-validated/*.md"
@@ -23,6 +25,6 @@ jobs:
2325
- name: Lint pattern files (markdown)
2426
uses: avto-dev/markdown-lint@v1
2527
with:
26-
rules: './lint/pattern-template.js'
27-
config: './lint/pattern-template.yml'
28+
rules: './.github/lint-pattern-syntax/pattern-template.js'
29+
config: './.github/lint-pattern-syntax/pattern-template.yml'
2830
args: 'patterns/2-structured/*.md patterns/2-structured/project-setup/*.md patterns/3-validated/*.md'

.github/workflows/vale.yml

+26
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Spelling & Styles
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
paths:
8+
- '**.md'
9+
pull_request:
10+
branches:
11+
- main
12+
13+
jobs:
14+
vale:
15+
runs-on: ubuntu-latest
16+
17+
steps:
18+
- uses: actions/checkout@v3
19+
20+
- name: Vale Linting
21+
uses: errata-ai/vale-action@reviewdog
22+
with:
23+
files: '["patterns/2-structured/", "patterns/3-validated/"]'
24+
vale_flags: "--glob=*.md"
25+
filter_mode: added
26+
debug: true

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# We want to ignore our vale StylesPath
2+
.github/vale/*

.lycheeignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@ https://example.com/link/to/your/trusted/committer/documentation.md
44
https://github.com/rcs/rcs-viewer/pull/81
55
http://creativecommons.org/licenses
66
https://isc-inviter.herokuapp.com
7+
https://innersourcecommons-inviter.herokuapp.com
78
fearlesschangepatterns.com
89
https://ulir.ul.ie/bitstream/handle/10344/4443/Stol_2014_inner.pdf
910
.*@andrew.clegg.*
1011
https://m.dotdev.co/how-to-write-a-readme-that-rocks-bc29f279611a
11-
https://innersourcecommons-inviter.herokuapp.com
12+
https://www.chathamhouse.org/about-us/chatham-house-rule

.vale.ini

+12
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
StylesPath = .github/vale
2+
MinAlertLevel = suggestion
3+
4+
Packages = https://github.com/InnerSourceCommons/isc-styles/releases/latest/download/ISC.zip
5+
6+
Vocab = Base
7+
8+
[*]
9+
BasedOnStyles = ISC
10+
11+
; If you **don't** want to check for the correct spelling of "InnerSource", comment this in
12+
; ISC.InnerSource = NO

CONTRIBUTING.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ We are happy to support you in contributing to the InnerSource patterns or to ju
2929

3030
You can best reach out to us **via Slack**:
3131

32-
Join the InnerSource Commons [Slack instance](https://isc-inviter.herokuapp.com/) and enter the `#innersource-patterns` channel there.
32+
Join the InnerSource Commons [Slack instance](https://innersourcecommons.org/slack) and enter the `#innersource-patterns` channel there.
3333

3434
## License of Contributions
3535

0 commit comments

Comments
 (0)