-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Use external ght-render for ght-render-repo action (#9)
* Use external ght-render action for PR and Push * Update ISSUE_TEMPLATE.md.ght - Add header * Remove ght-render dead-code
- Loading branch information
Showing
3 changed files
with
28 additions
and
136 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 |
---|---|---|
@@ -1,3 +1,4 @@ | ||
### Environment Information | ||
* {{ cookiecutter.project_name }} version: | ||
* Python version: | ||
* Operating System: | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,6 +3,9 @@ on: | |
pull_request: | ||
branches: | ||
- ght/master | ||
push: | ||
branches: | ||
- ght/master | ||
|
||
jobs: | ||
ght-render-repo: | ||
|
@@ -13,81 +16,33 @@ jobs: | |
ref: ${{ github.head_ref }} | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Add ght-pypackage remote | ||
run: | | ||
git remote add ght-pypackage https://github.com/sodre/ght-pypackage.git | ||
git fetch ght-pypackage | ||
- name: Prepare tree for re-rendering | ||
run: | | ||
git rm -rf . | ||
git checkout remotes/ght-pypackage/master -- . | ||
git checkout ${{ github.head_ref }} -- .github/ght.yaml | ||
- name: Set up Python 3.7 | ||
uses: actions/setup-python@v1 | ||
- name: Render the project template | ||
uses: sodre/ght-render@master | ||
with: | ||
python-version: 3.7 | ||
- name: Install ght-render dependencies | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install jinja2 jinja2-cli jinja2-time pyyaml | ||
- run: | | ||
.github/bin/ght-render.sh render-tree-structure | ||
.github/bin/ght-render.sh render-tree-ght-content | ||
.github/bin/ght-render.sh render-tree-content | ||
#.github/bin/ght-render.sh remove-workflows | ||
- uses: stefanzweifel/[email protected] | ||
with: | ||
commit_message: Apply automatic changes | ||
branch: ${{ github.head_ref }} | ||
template: sodre/ght-pypackage@master | ||
|
||
- name: Push changes to ght/master | ||
if: github.event_name == 'push' | ||
run: git push --set-upstream origin HEAD:${{ github.ref }} | ||
- name: Push changes to head_ref | ||
if: github.event_name == 'pull_request' | ||
run: git push --set-upstream origin ${{ github.head_ref}} | ||
|
||
- name: Create pull-request against master | ||
uses: octokit/[email protected] | ||
if: github.event_name == 'push' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
# - run: | | ||
# git config --global user.email "[email protected]" | ||
# git config --global user.name "Auto-commit" | ||
# git commit -m 'auto-commit' | ||
# git push --set-upstream origin HEAD:${{ github.head_ref }} --force | ||
|
||
- name: Create Pull Request | ||
uses: peter-evans/create-pull-request@v1 | ||
if: false | ||
with: | ||
token: ${{ secrets.GITHUB_TOKEN }} | ||
route: POST /repos/:repository/pulls | ||
repository: ${{ github.repository }} | ||
title: Merge ght/master into master | ||
head: ght/master | ||
base: master | ||
branch: ght/render | ||
branch-suffix: timestamp | ||
commit-message: | | ||
Render ght/master into master | ||
This commit was obtained as follows: | ||
1. Checkout the last merged rendering of ght/master | ||
git checkout ${{ steps.last-render.outputs.treeish }} | ||
2. Replace its contents with ght/master | ||
git rm -rf . | ||
git checkout origin/ght/master -- . | ||
3. Load the configured ght.yaml from PR #${{ github.event.number }} file | ||
git checkout ${{ github.sha }} -- .github/ght.yaml | ||
4. Execute the rendering steps | ||
.github/bin/ght-render.sh render_tree_structure | ||
.github/bin/ght-render.sh render_tree_ght_content | ||
.github/bin/ght-render.sh render_tree_content | ||
.github/bin/ght-render.sh finish | ||
5. Commit | ||
git commit | ||
Close #${{ github.event.number }} | ||
title: Render ght/master into master | ||
reviewers: ${{ github.actor }} | ||
labels: ght | ||
body: | | ||
Please review the changes and fix any conflicts before merging. | ||
If the configuration variables were incorrect, please close this PR and | ||
use your ght-configure PR #${{ github.event.number }} to edit the values. | ||
| | ||
Modifications to ght/master were detected. | ||
- [ ] Review the changes | ||
- [ ] Fix the errors by committing back to ght/master | ||
- [ ] Do **not** use Squash or Rebase | ||
- [ ] Do **not** delete the ght/master branch |