Skip to content

Commit e729367

Browse files
committed
✨ use moban-jinja2-github plugin and enable moban-update.yaml
1 parent 281d2e6 commit e729367

File tree

4 files changed

+45
-0
lines changed

4 files changed

+45
-0
lines changed

README.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -171,6 +171,13 @@ In order to use dependency markers in `setup.py`, add `setup_use_markers: true`
171171
in your `mobanfile.
172172

173173

174+
Auto generate contributors
175+
--------------------------------------------------------------------------------
176+
177+
Github has a record all contributors, hence it is possible to generate
178+
contributors list from github call.
179+
180+
174181
Developer Guides
175182
================================================================================
176183

statics/moban-update.yml

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
on: [push]
2+
3+
jobs:
4+
run_moban:
5+
runs-on: ubuntu-latest
6+
name: synchronize templates via moban
7+
steps:
8+
- uses: actions/checkout@v2
9+
with:
10+
ref: ${{ github.head_ref }}
11+
- name: Set up Python
12+
uses: actions/setup-python@v1
13+
with:
14+
python-version: '3.7'
15+
- name: check changes
16+
run: |
17+
pip install moban gitfs2 pypifs
18+
moban
19+
git status
20+
git diff --exit-code
21+
- name: Auto-commit
22+
if: failure()
23+
uses: docker://cdssnc/auto-commit-github-action
24+
env:
25+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
26+
with:
27+
args: This is an auto-commit, updating project meta data, such as changelog.rst, contributors.rst

templates/CONTRIBUTORS.rst.jj2

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{% set contributors = moban_jinja2_contributors(name, organisation, author) %}
2+
3+
{{ contributors|length }} contributors
4+
================================================================================
5+
6+
In alphabetical order:
7+
8+
{% for contributor in contributors|sort(attribute='name') %}
9+
* `{{ contributor.name }} <{{ contributor.url }}>`_
10+
{% endfor %}

tests/requirements.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ codecov
22
moban>=0.6.4
33
pytest~=3.6.1
44
flake8
5+
moban_jinja2_github
56
yamllint

0 commit comments

Comments
 (0)