From cfa545f45b6e991a4eb327706b9d5c05a9c9dfbd Mon Sep 17 00:00:00 2001 From: Alexandre Aubin Date: Tue, 11 May 2021 02:14:21 +0200 Subject: [PATCH] Add issue-and-pr-template autopatch --- autopatches/autopatch.py | 8 ++++---- autopatches/patches/issue-and-pr-template/patch.sh | 14 ++++++++++++++ .../patches/issue-and-pr-template/pr_body.md | 2 ++ .../patches/issue-and-pr-template/pr_title.md | 1 + 4 files changed, 21 insertions(+), 4 deletions(-) create mode 100644 autopatches/patches/issue-and-pr-template/patch.sh create mode 100644 autopatches/patches/issue-and-pr-template/pr_body.md create mode 100644 autopatches/patches/issue-and-pr-template/pr_title.md diff --git a/autopatches/autopatch.py b/autopatches/autopatch.py index 12235525..746ee51a 100755 --- a/autopatches/autopatch.py +++ b/autopatches/autopatch.py @@ -161,16 +161,16 @@ def main(): Example usage: # Init local git clone for all apps -./autopatch --build-cache +./autopatch.py --build-cache # Apply patch in all local clones -./autopatch --apply explicit-php-version-in-deps +./autopatch.py --apply explicit-php-version-in-deps # Inspect diff for all apps -./autopatch --diff +./autopatch.py --diff # Push and create pull requests on all apps with non-empty diff -./autopatch --push explicit-php-version-in-deps +./autopatch.py --push explicit-php-version-in-deps """) elif action == "--build-cache": diff --git a/autopatches/patches/issue-and-pr-template/patch.sh b/autopatches/patches/issue-and-pr-template/patch.sh new file mode 100644 index 00000000..d52d3b02 --- /dev/null +++ b/autopatches/patches/issue-and-pr-template/patch.sh @@ -0,0 +1,14 @@ + +[ ! -e issue_template.md ] || git rm issue_template.md +[ ! -e pull_request_template.md ] || git rm pull_request_template.md + +[ ! -e .github ] || git rm -rf .github +mkdir -p .github + +# Sleep 1 to avoid too many requests on github (there's a rate limit anyway) +sleep 1 + +wget -O .github/ISSUE_TEMPLATE.md https://raw.githubusercontent.com/YunoHost/example_ynh/master/.github/ISSUE_TEMPLATE.md +wget -O .github/PULL_REQUEST_TEMPLATE.md https://raw.githubusercontent.com/YunoHost/example_ynh/master/.github/PULL_REQUEST_TEMPLATE.md + +git add .github diff --git a/autopatches/patches/issue-and-pr-template/pr_body.md b/autopatches/patches/issue-and-pr-template/pr_body.md new file mode 100644 index 00000000..471273e8 --- /dev/null +++ b/autopatches/patches/issue-and-pr-template/pr_body.md @@ -0,0 +1,2 @@ + +This is an ***automated*** patch to sync the issue and PR template with the official templates in https://github.com/YunoHost/example_ynh/tree/master/.github diff --git a/autopatches/patches/issue-and-pr-template/pr_title.md b/autopatches/patches/issue-and-pr-template/pr_title.md new file mode 100644 index 00000000..f0bed1c1 --- /dev/null +++ b/autopatches/patches/issue-and-pr-template/pr_title.md @@ -0,0 +1 @@ +Update issue and PR templates