-
Notifications
You must be signed in to change notification settings - Fork 61
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add an Ouranos Helper Bot for bumping the main branch version, Workfl…
…ow cleanup, Address security warnings (#1790) <!--Please ensure the PR fulfills the following requirements! --> <!-- If this is your first PR, make sure to add your details to the AUTHORS.rst! --> ### Pull Request Checklist: - [ ] This PR addresses an already opened issue (for bug fixes / features) - This PR fixes #xyz - [ ] Tests for the changes have been added (for bug fixes / features) - [ ] (If applicable) Documentation has been added / updated (for bug fixes / features) - [x] CHANGES.rst has been updated (with summary of main changes) - [x] Link to issue (:issue:`number`) and pull request (:pull:`number`) has been added ### What kind of change does this PR introduce? * Adds a GitHub App integration for bumping the main branch when events trigger the `bumpversion.yml` workflow. * bump-my-version has been bumped to the latest version (v0.23.0) * netcdf4 has been pinned for stability reasons ### Does this PR introduce a breaking change? The repository now uses GitHub repository rulesets (recommended) instead of branch protections (older) ### Other information: https://medium.com/@lauravuo/managing-github-branch-protections-4fa37b36ee4f
- Loading branch information
Showing
37 changed files
with
166 additions
and
163 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 |
---|---|---|
|
@@ -6,9 +6,6 @@ exclude = | |
.eggs, | ||
tests | ||
ignore = | ||
AZ100, | ||
AZ200, | ||
AZ300, | ||
C, | ||
D, | ||
E, | ||
|
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
|
@@ -9,6 +9,7 @@ on: | |
- .github/*/*.md | ||
- .github/*/*.yml | ||
- CHANGES.rst | ||
- CI/*.txt | ||
- Makefile | ||
- docs/*/*.ipynb | ||
- docs/*/*.py | ||
|
@@ -19,7 +20,6 @@ on: | |
- environment.yml | ||
- pylintrc | ||
- pyproject.toml | ||
- requirements_upstream.txt | ||
- tox.ini | ||
- xclim/__init__.py | ||
|
||
|
@@ -43,26 +43,31 @@ jobs: | |
files.pythonhosted.org:443 | ||
github.com:443 | ||
pypi.org:443 | ||
- name: Generate App Token | ||
id: token_generator | ||
uses: actions/create-github-app-token@c8f55efbd427e7465d6da1106e7979bc8aaee856 # v1.10.1 | ||
with: | ||
app-id: ${{ secrets.OURANOS_HELPER_BOT_ID }} | ||
private-key: ${{ secrets.OURANOS_HELPER_BOT_KEY }} | ||
- uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7 | ||
with: | ||
persist-credentials: false | ||
token: ${{ steps.token_generator.outputs.token }} | ||
- uses: actions/setup-python@82c7e631bb3cdc910f68e0081d67478d79c6982d # v5.1.0 | ||
with: | ||
python-version: "3.x" | ||
- name: Config Commit Bot | ||
run: | | ||
git config --local user.email "bumpversion[bot]@ouranos.ca" | ||
git config --local user.name "bumpversion[bot]" | ||
git config --local user.email "ouranos-helper-[email protected]" | ||
git config --local user.name "ouranos-helper-bot" | ||
- name: Current Version | ||
run: | | ||
CURRENT_VERSION="$(grep -E '__version__' xclim/__init__.py | cut -d ' ' -f3)" | ||
echo "current_version=${CURRENT_VERSION}" | ||
echo "CURRENT_VERSION=${CURRENT_VERSION}" >> $GITHUB_ENV | ||
- name: Install bump-my-version | ||
- name: Install CI libraries | ||
run: | | ||
python -m pip install bump-my-version==0.21.0 | ||
python -m pip install -r CI/requirements_ci.txt | ||
- name: Conditional Bump | ||
id: bump | ||
run: | | ||
if [[ ${{ env.CURRENT_VERSION }} =~ -dev(\.\d+)? ]]; then | ||
echo "Development version (ends in 'dev(\.\d+)?'), bumping 'build' version" | ||
|
@@ -75,8 +80,7 @@ jobs: | |
echo "new_version=${NEW_VERSION}" | ||
echo "NEW_VERSION=${NEW_VERSION}" >> $GITHUB_ENV | ||
- name: Push Changes | ||
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df | ||
uses: ad-m/github-push-action@d91a481090679876dfc4178fef17f286781251df # v0.8.0 | ||
with: | ||
force: false | ||
github_token: ${{ secrets.BUMP_VERSION_TOKEN }} | ||
branch: ${{ github.ref }} |
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
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
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
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
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
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.