-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
update cookiecutter to latest commit (#70)
### What kind of change does this PR introduce? * Updates the cookiecutter to the latest commits * `xhydro` is now Semantic Version v2.0.0-compliant * Added a few workflows (Change file labelling, Cache cleaning, Dependency scans, OpenSSF Scorecard) * Updated pre-commit hook versions * Formatting tools are now pinned to their pre-commit equivalents * `actions-version-updater.yml` has been replaced by `dependabot` ### Does this PR introduce a breaking change? Boilerplate documentation is largely unchanged. Workflows are now more a bit more elegant, including automatic labelling, warnings about unsafe changes to workflows, security-related changes, etc. `actions-versions-updater.yml` has been replaced with `Dependendabot` (it's just better). There's support for evaluating the OpenSSF Scorecard (this can be disabled if we want). Code formatting tools are now hard-pinned. These need to be kept in sync with changes from `pre-commit`. `Dependabot` should do this task automatically via Pull Requests. Versioning scheme is now SemVer 2.0-compliant: * If the version doesn't end in `-dev` or `-dev.##`, `$ bump-my-version bump patch` will be called. This will set the version at `X.Y.Z+1-dev`. Otherwise, `$ bump-my-version bump build` will be called. This is all automated by the `bump-version.yml`. When the version is ready for a release, it's up to the maintainer to call the following: * `$ bump-my-version bump release` (for a patch release; i.e. `1.2.0` → `1.2.1`) or * `$ bump-my-version bump minor` then `$ bump-my-version bump release` (for a minor release; i.e. `1.2.0` → `1.3.0`) ### Other information: Ouranosinc/cookiecutter-pypackage#30
- Loading branch information
Showing
32 changed files
with
509 additions
and
81 deletions.
There are no files selected for viewing
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
File renamed without changes.
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,15 @@ | ||
version: 2 | ||
updates: | ||
- package-ecosystem: github-actions | ||
directory: / | ||
schedule: | ||
interval: daily | ||
time: '12:00' | ||
open-pull-requests-limit: 10 | ||
|
||
- package-ecosystem: pip | ||
directory: / | ||
schedule: | ||
interval: daily | ||
time: '12:00' | ||
open-pull-requests-limit: 10 |
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,20 @@ | ||
# label rules used by .github/workflows/label.yml | ||
|
||
# label 'ci' all automation-related steps and files | ||
# Since this repository is in itself an automation process to deploy a server instance, | ||
# we refer here to CI as the 'meta' configuration files for managing the code and integrations with the repository, | ||
# not configurations related to the deployment process itself. | ||
|
||
# Uncomment the following lines to enable the labeler (requires labels with the same name to exist in the repository) | ||
|
||
# label 'ci' all automation-related steps and files | ||
'CI': | ||
- changed-files: | ||
- any-glob-to-any-file: | ||
- '.editorconfig' | ||
- '.flake8' | ||
- '.pre-commit-config.yaml' | ||
- '.yamllint.yml' | ||
- '.github/workflows/*' | ||
- 'tox.ini' | ||
- 'Makefile' |
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 |
---|---|---|
@@ -0,0 +1,47 @@ | ||
# Example taken from https://docs.github.com/en/actions/using-workflows/caching-dependencies-to-speed-up-workflows#managing-caches | ||
name: Cleanup Caches on Pull Request Merge | ||
on: | ||
pull_request: | ||
types: | ||
- closed | ||
|
||
permissions: # added using https://github.com/step-security/secure-repo | ||
contents: read | ||
|
||
jobs: | ||
cleanup: | ||
name: Cleanup | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
objects.githubusercontent.com:443 | ||
- uses: actions/checkout@v4.1.1 | ||
|
||
- name: Cleanup | ||
run: | | ||
gh extension install actions/gh-actions-cache | ||
REPO=${{ github.repository }} | ||
BRANCH="refs/pull/${{ github.event.pull_request.number }}/merge" | ||
echo "Fetching list of cache key" | ||
cacheKeysForPR=$(gh actions-cache list -R $REPO -B $BRANCH -L 100 | cut -f 1 ) | ||
## Setting this to not fail the workflow while deleting cache keys. | ||
set +e | ||
echo "Deleting caches..." | ||
for cacheKey in $cacheKeysForPR | ||
do | ||
gh actions-cache delete $cacheKey -R $REPO -B $BRANCH --confirm | ||
done | ||
echo "Done" | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
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,31 @@ | ||
# Dependency Review Action | ||
# | ||
# This Action will scan dependency manifest files that change as part of a Pull Request, surfacing known-vulnerable versions of the packages declared or updated in the PR. Once installed, if the workflow run is marked as required, PRs introducing known-vulnerable packages will be blocked from merging. | ||
# | ||
# Source repository: https://github.com/actions/dependency-review-action | ||
# Public documentation: https://docs.github.com/en/code-security/supply-chain-security/understanding-your-software-supply-chain/about-dependency-review#dependency-review-enforcement | ||
name: 'Dependency Review' | ||
on: | ||
pull_request: | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
dependency-review: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
github.com:443 | ||
- name: 'Checkout Repository' | ||
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1 | ||
|
||
- name: 'Dependency Review' | ||
uses: actions/dependency-review-action@4901385134134e04cec5fbe5ddfe3b2c5bd5d976 |
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 |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# This workflow will triage pull requests and apply a label based on the | ||
# paths that are modified in the pull request. | ||
# | ||
# To use this workflow, you will need to set up a .github/labeler.yml | ||
# file with configuration. For more information, see: | ||
# https://github.com/actions/labeler/blob/master/README.md | ||
|
||
name: Labeler | ||
on: | ||
pull_request_target: | ||
# Note: potential security risk from this action using pull_request_target. | ||
# Do not add actions in here which need a checkout of the repo, and do not use any caching in here. | ||
# See: https://docs.github.com/en/actions/using-workflows/events-that-trigger-workflows#pull_request_target | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
label: | ||
name: Label | ||
runs-on: ubuntu-latest | ||
permissions: | ||
checks: write | ||
contents: read | ||
pull-requests: write | ||
steps: | ||
- name: Harden Runner | ||
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1 | ||
with: | ||
disable-sudo: true | ||
egress-policy: block | ||
allowed-endpoints: > | ||
api.github.com:443 | ||
- uses: actions/labeler@v5.0.0 | ||
with: | ||
repo-token: ${{ secrets.GITHUB_TOKEN }} |
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.