-
Notifications
You must be signed in to change notification settings - Fork 151
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into graveyard_garradin
- Loading branch information
Showing
251 changed files
with
19,759 additions
and
5,632 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#! /usr/bin/env python3 | ||
|
||
""" | ||
Super small script for github action to detect if 2 .pot files have changed for | ||
github/workflows/auto_messages_pot.yml | ||
""" | ||
|
||
import sys | ||
from babel.messages.pofile import PoFileParser | ||
|
||
|
||
def load_pot_file(file_path): | ||
poparser = PoFileParser({}) | ||
poparser.parse(open(file_path)) | ||
return poparser.catalog | ||
|
||
|
||
def main(): | ||
file_1 = load_pot_file(sys.argv[1]) | ||
file_2 = load_pot_file(sys.argv[2]) | ||
|
||
if [x for x in file_1.keys() if x] == [x for x in file_2.keys() if x]: | ||
print("false") | ||
else: | ||
print("true") | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,6 +12,7 @@ jobs: | |
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
token: ${{ secrets.YUNOHOST_BOT_TOKEN }} | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
|
@@ -30,3 +31,6 @@ jobs: | |
with: | ||
commit_message: "Automatically add dates to the catalog files" | ||
file_pattern: 'apps.toml wishlist.toml graveyard.toml' | ||
commit_user_name: yunohost-bot | ||
commit_user_email: [email protected] | ||
commit_author: 'yunohost-bot <[email protected]>' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
name: Auto updates messages.pot for readme_generator | ||
on: | ||
push: | ||
branches: | ||
- master | ||
|
||
jobs: | ||
pybabel: | ||
name: Auto updates messages.pot for readme_generator | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python 3.11 | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: 3.11 | ||
- name: Install dependencies | ||
run: | | ||
cd tools/readme_generator/ | ||
pip install -r requirements.txt | ||
- name: Save old messges.pot for diffing later | ||
run: | | ||
cd tools/readme_generator/ | ||
cp messages.pot messages.pot.old | ||
- name: Try to generate messages.pot | ||
run: | | ||
cd tools/readme_generator/ | ||
pybabel extract --ignore-dirs venv -F babel.cfg -o messages.pot . | ||
- shell: pwsh | ||
id: check_files_changed | ||
run: | | ||
$HasDiff = python .github/diff_pot_files.py tools/readme_generator/messages.pot.old tools/readme_generator/messages.pot | ||
Write-Host "::set-output name=files_changed::$HasDiff" | ||
- name: Create Pull Request | ||
if: steps.check_files_changed.outputs.files_changed == 'true' | ||
uses: peter-evans/create-pull-request@v6 | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
title: "Update messages.pot for readme_generator" | ||
commit-message: "chore(readme_generator): update messages.pot" | ||
body: | | ||
This pull request has been generated using the command `pybabel extract --ignore-dirs venv -F babel.cfg -o messages.pot .` | ||
base: ${{ github.head_ref }} # Creates pull request onto pull request or commit branch | ||
branch: actions/auto_messages_pot |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.