Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dummy #458

Closed
wants to merge 3 commits into from
Closed

Dummy #458

Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 20 additions & 0 deletions .github/workflows/auto_approve.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Auto approve PR
on:
pull_request:
types: [opened, reopened]
jobs:
move-assigned-card:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: setup git
run: |
git config --global user.name "GH Actions bot"
git config --global user.email "<>"
- name: Auto approve PR
run: |
gh pr review --approve -b "You seem like a trust worthy individual. I'll just approve this for you, I'm sure it's fine. Right?" $PR
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PR: ${{ github.event.pull_request.number }}
2 changes: 1 addition & 1 deletion .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ on:

jobs:
# Build docs on Linux
Docs:
docs:
timeout-minutes: 10
name: linux docs
runs-on: ubuntu-latest
Expand Down
28 changes: 28 additions & 0 deletions .github/workflows/update_dev_version.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@

on:
pull_request_review:
types:
- submitted
workflow_dispatch:


jobs:
update_version:
if: github.event.review.state == 'approved'
runs-on: ubuntu-latest
steps:
- name: Checkout source
uses: actions/checkout@v3
- name: configure git
run: |
git config user.name "GitHub Actions Bot"
git config user.email "<>"
- name: update version
run: |
last_release=$(git tag --list | tail -n 1)
num_commits_since_release=$(($(git rev-list $last_release..main | wc -l) + 1 ))
sed -i "s/__version__\s*=\s*\"(\d+\.\d+\.\d+).dev(\d+)\"/__version__ = \"$1.dev$num_commits_since_release\"/" hydromt/__init__.py
git add hydromt/__init__.py
git commit -m "update version"
git push origin ${{ github.ref_name}} -f
gh pr comment ${{ github.ref_name }} -b "I've updated the version for you. Feel free to merge now!"
Empty file added dirty.txt
Empty file.
2 changes: 1 addition & 1 deletion docs/changelog.rst
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ Unreleased

Added
-----
-
- Versions of HydroMT between releases are now updated automatically when the PR is approved. (#455)

Changed
-------
Expand Down
6 changes: 4 additions & 2 deletions docs/dev/contributing.rst
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,9 @@ If you found a bug or an issue you would like to tackle or contribute to a new d
4. Update docs/changelog.rst file with a summary of your changes and a link to your pull request. See for example the `hydromt changelog <https://github.com/Deltares/hydromt/blob/main/docs/changelog.rst>`_.
5. Push your commits to the github repository and open a draft pull request. The body of the pull request will be pre-filled with a template. Please fill out this template with the relevant information, and complete the checklist included.
6. Once you're satisfied with the changes mark the pull request as "as ready for review" and ask another contributor to review the code. The review should cover the implementation as well as steps 2-4.
7. Merge the pull request once the review has been approved.
7. Once your request has been approved, a bot will add a commit to your branch to automatically update the version number. Please wait for this to complete before you merge. Once it is done, a comment saying "You're free to merge now" will be added to your PR.
8. Note that if you want to make changes after this commit has been added, you should pull the branch first to avoid merge conflicts.
9. You are now free to merge your pull request. Do merge with a `squash` commit!! This is important to make sure the version counting stays accurate.


.. _git-conventions:
Expand Down Expand Up @@ -181,7 +183,7 @@ It's telling us we first need to tell it what we want to do with the current con
Success!
This is a simple introduction into a potentially very complicated subject. You can read more about the different possibilities here:

* `Merge Conflicts <https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts>`_
* `Merge Conflicts <https://www.atlassian.com/git/tutorials/using-branches/merge-conflicts>`_
* `Merge Strategies <https://www.atlassian.com/git/tutorials/using-branches/merge-strategy>`_


Expand Down
1 change: 0 additions & 1 deletion hydromt/__init__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
"""HydroMT: Automated and reproducible model building and analysis."""

# version number without 'v' at start
__version__ = "0.8.1.dev0"

# Set environment variables (this will be temporary)
Expand Down
Loading