Skip to content

Commit 9c3215b

Browse files
authored
Help you to contribute (#105)
1 parent 369875a commit 9c3215b

File tree

8 files changed

+72
-6
lines changed

8 files changed

+72
-6
lines changed

.env.template

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
FORKED_ASSIGNEE=YOUR_HANDLE
2+
FORKED_DEFAULT_BRANCH=main
3+
FORKED_LABEL="from upstream"
4+
FORKED_REPOSITORY=YOUR_REPOSITORY/awesome-actions
5+
UPSTREAM_REPOSITORY=sdras/awesome-actions

.github/linters/.textlintrc

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@
44
"rules": {
55
"terminology": {
66
"skip": [ "Link" ],
7+
"exclude": [
8+
"readme(s)?"
9+
],
710
"terms": [
811
[ "README(s)?", "README$1" ]
9-
],
10-
"exclude": [
11-
[ "readme(s)?", "readme$1" ]
1212
]
1313
}
1414
}

.github/workflows/lint.yml

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,7 @@ jobs:
2323
steps:
2424
- uses: actions/checkout@v4
2525

26-
- run: npx awesome-lint
26+
- uses: taiki-e/install-action@just
27+
28+
- run: just awesome-lint
2729
shell: bash

.github/workflows/linter.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,4 +37,3 @@ jobs:
3737
VALIDATE_MARKDOWN_PRETTIER: false
3838
VALIDATE_JSON_PRETTIER: false
3939
VALIDATE_GIT_COMMITLINT: false
40-
VALIDATE_NATURAL_LANGUAGE: "${{ vars.VALIDATE_NATURAL_LANGUAGE || true }}"

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
.env

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,7 @@ Set up your GitHub Actions workflow with a specific version of your programming
444444
- [Mention Completed Pull Requests in Draft Release](https://github.com/dnbkr/clog)
445445
- [Recap](https://github.com/flowwer-dev/recap) - Summarize the most significant changes in a pull request using OpenAI ChatGPT.
446446
- [Semantic Pull Request Composer](https://github.com/mateoguzmana/semantic-pr-composer) - Automatically composes the pull request title and body based on the branch name, which follows a semantic convention. Optional AI autocompletion using OpenAI completions API is also available.
447-
- [Get Merged Pull Requests](https://github.com/VanOns/get-merged-pull-requests-action) - GitHub action that compares 2 tags and retrieves all pull requests merged between them.
447+
- [Get Merged Pull Requests](https://github.com/VanOns/get-merged-pull-requests-action) - GitHub Action that compares 2 tags and retrieves all pull requests merged between them.
448448
- [Catch Performance Regressions in Pull Requests](https://github.com/bencherdev/bencher)
449449

450450
### GitHub Pages

contributing.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,4 +36,16 @@ Thank you for your suggestions!
3636

3737
Sometimes, we will ask you to edit your Pull Request before it is included. This is normally due to spelling errors or because your PR didn't match the awesome-actions list guidelines.
3838

39+
You can also run some [just](https://just.systems) receipe to help you reduce the editing:
40+
41+
> [!TIP]
42+
> **prerequisites**
43+
>
44+
> - Install the right `just` [package](https://just.systems/man/en/packages.html),
45+
> - Install the right `node` [package](https://nodejs.org/en/download).
46+
>
47+
> Than `just configure` to prepare your local machine.
48+
49+
- `just feedback` to run all related linters on your contribution.
50+
3951
[Here](https://github.com/RichardLitt/knowledge/blob/master/github/amending-a-commit-guide.md) is a write up on how to change a Pull Request, and the different ways you can do that.

justfile

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
#!/usr/bin/env -S just --justfile
2+
3+
set quiet := true
4+
set dotenv-load := true
5+
6+
default:
7+
just --choose
8+
9+
# Configure all needed packages
10+
[group('Configuration')]
11+
configure: configure-textlint
12+
13+
# Configure the fork for maintenance
14+
[group('Configuration')]
15+
configure-fork:
16+
#!/usr/bin/env bash
17+
[ ! -f .env ] && cp .env.template .env
18+
echo "Adapt your .env to your need :"
19+
cat .env
20+
21+
# Install textlint and rules
22+
[group('Configuration')]
23+
configure-textlint:
24+
npm install textlint -g
25+
npm install textlint-rule-terminology -g
26+
27+
# Give feedback on contribution
28+
[group('Contribution')]
29+
feedback: awesome-lint textlint
30+
31+
# Run textlint
32+
[group('Contribution')]
33+
textlint:
34+
textlint -c .github/linters/.textlintrc *
35+
36+
# Run awesome-lint
37+
[group('Contribution')]
38+
awesome-lint:
39+
npx awesome-lint
40+
41+
# Helper to create a PR in the forked repository taken from the upstream one
42+
[group('Fork Maintenance')]
43+
maintain-fork upstream_pr="":
44+
gh pr checkout -b {{ upstream_pr }} "https://github.com/${UPSTREAM_REPOSITORY}/pull/{{ upstream_pr }}"
45+
git push origin {{ upstream_pr }}
46+
gh pr create -a "${FORKED_ASSIGNEE}" -l "${FORKED_LABEL}" -t "$(gh pr view {{ upstream_pr }} --json title --jq '.title')" -b "Linked to ${UPSTREAM_REPOSITORY}#{{ upstream_pr }}" -H {{ upstream_pr }} -B "${FORKED_DEFAULT_BRANCH}" -R "${FORKED_REPOSITORY}"
47+
git checkout "${FORKED_DEFAULT_BRANCH}"

0 commit comments

Comments
 (0)