Skip to content

Commit

Permalink
Merge branch 'master' into security-policy
Browse files Browse the repository at this point in the history
  • Loading branch information
Zeitsperre committed Jan 23, 2024
2 parents a1cea00 + b8446c4 commit dc0348c
Show file tree
Hide file tree
Showing 47 changed files with 909 additions and 751 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,13 @@ jobs:
github.com:443
- name: Checkout
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
token: ${{ secrets.ACTIONS_VERSION_UPDATER_TOKEN }}
persist-credentials: true

- name: Run GitHub Actions Version Updater
uses: saadmk11/[email protected]
uses: saadmk11/github-actions-version-updater@64be81ba69383f81f2be476703ea6570c4c8686e # v0.8.1
with:
token: ${{ secrets.ACTIONS_VERSION_UPDATER_TOKEN }}
committer_email: 'bumpversion[bot]@ouranos.ca'
Expand Down
15 changes: 15 additions & 0 deletions .github/dependabot.yml
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: 5

- package-ecosystem: pip
directory: /
schedule:
interval: daily
time: '12:00'
open-pull-requests-limit: 5
4 changes: 2 additions & 2 deletions .github/workflows/add-to-project.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types:
- opened

permissions: # added using https://github.com/step-security/secure-repo
permissions:
contents: read

jobs:
Expand All @@ -24,7 +24,7 @@ jobs:
allowed-endpoints: >
api.github.com:443
- uses: actions/[email protected]
- uses: actions/add-to-project@31b3f3ccdc584546fc445612dec3f38ff5edb41c # v0.5.0
with:
project-url: https://github.com/orgs/Ouranosinc/projects/6
github-token: ${{ secrets.ADD_TO_PROJECT_TOKEN }}
6 changes: 3 additions & 3 deletions .github/workflows/bump-version.yml
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ on:
- tox.ini
- xclim/__init__.py

permissions: # added using https://github.com/step-security/secure-repo
permissions:
contents: read

jobs:
Expand All @@ -43,10 +43,10 @@ jobs:
files.pythonhosted.org:443
github.com:443
pypi.org:443
- uses: actions/[email protected]
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
with:
persist-credentials: false
- uses: actions/[email protected]
- uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.x"
- name: Config Commit Bot
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/cache-cleaner.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types:
- closed

permissions: # added using https://github.com/step-security/secure-repo
permissions:
contents: read

jobs:
Expand All @@ -23,7 +23,7 @@ jobs:
objects.githubusercontent.com:443
- name: Check out code
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Cleanup
run: |
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/codeql-analysis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ jobs:
pypi.org:443
uploads.github.com:443
- name: Checkout repository
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@1245696032ecf7d39f87d54daa406e22ddf769a8
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/dependency-review.yml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ jobs:
github.com:443
- name: 'Checkout Repository'
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: 'Dependency Review'
uses: actions/dependency-review-action@c74b580d73376b7750d3d2a50bfb8adc2c937507
uses: actions/dependency-review-action@4901385134134e04cec5fbe5ddfe3b2c5bd5d976
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types:
- opened

permissions: # added using https://github.com/step-security/secure-repo
permissions:
contents: read

jobs:
Expand All @@ -24,7 +24,7 @@ jobs:
allowed-endpoints: >
api.github.com:443
- uses: actions/[email protected]
- uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
// Get a list of all issues created by the PR opener
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ jobs:
api.github.com:443
- name: Label Approved
uses: actions/[email protected]
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
with:
script: |
github.rest.issues.addLabels({
Expand All @@ -58,20 +58,23 @@ jobs:
- name: Harden Runner
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
disable-sudo: true
egress-policy: block
allowed-endpoints: >
api.github.com:443
- name: Find comment
uses: peter-evans/[email protected]
uses: peter-evans/find-comment@a54c31d7fa095754bfef525c0c8e5e5674c4b4b1 # v2.4.0
id: fc
with:
issue-number: ${{ github.event.pull_request.number }}
comment-author: 'github-actions[bot]'
body-includes: This Pull Request is coming from a fork and must be manually tagged `approved` in order to perform additional testing
body-includes: This Pull Request is coming from a fork and must be manually tagged `approved` in order to perform additional testing.
- name: Create comment
if: |
(steps.fc.outputs.comment-id == '') &&
(!contains(github.event.pull_request.labels.*.name, 'approved')) &&
(github.event.pull_request.head.repo.full_name != github.event.pull_request.base.repo.full_name)
uses: peter-evans/[email protected]
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2 # v3.1.0
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
Expand All @@ -82,7 +85,7 @@ jobs:
- name: Update comment
if: |
contains(github.event.pull_request.labels.*.name, 'approved')
uses: peter-evans/[email protected]
uses: peter-evans/create-or-update-comment@23ff15729ef2fc348714a3bb66d2f655ca9066f2 # v3.1.0
with:
comment-id: ${{ steps.fc.outputs.comment-id }}
issue-number: ${{ github.event.pull_request.number }}
Expand Down
10 changes: 8 additions & 2 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,10 +6,15 @@
# https://github.com/actions/labeler/blob/master/README.md

name: Labeler
on: [pull_request_target]
on:
# 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
pull_request_target:
types:
- opened
- reopened
- synchronize

permissions:
contents: read
Expand All @@ -30,6 +35,7 @@ jobs:
egress-policy: block
allowed-endpoints: >
api.github.com:443
- uses: actions/[email protected]
- uses: actions/labeler@8558fd74291d67161a8a78ce36a881fa63b766a9 # v5.0.0
with:
repo-token: "${{ secrets.GITHUB_TOKEN }}"
27 changes: 15 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,16 +52,16 @@ jobs:
files.pythonhosted.org:443
github.com:443
pypi.org:443
- uses: actions/[email protected]
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python${{ matrix.python-version }}
uses: actions/[email protected]
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install pylint and tox
run: pip install pylint tox~=4.0
- name: Run pylint
run: |
python -m pylint --rcfile=pylintrc --disable=import-error --exit-zero xclim
python -m pylint --rcfile=.pylintrc.toml --disable=import-error --exit-zero xclim
- name: Run linting suite
run: |
python -m tox -e lint
Expand All @@ -88,9 +88,9 @@ jobs:
github.com:443
pypi.org:443
raw.githubusercontent.com:443
- uses: actions/[email protected]
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python${{ matrix.python-version }}
uses: actions/[email protected]
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand Down Expand Up @@ -126,6 +126,9 @@ jobs:
- tox-env: py311-coverage-sbck
python-version: "3.11"
markers: -m 'not slow'
- tox-env: py312-coverage-numba
python-version: "3.12"
markers: -m 'not slow'
- tox-env: notebooks_doctests
python-version: "3.10"
- tox-env: offline-prefetch
Expand All @@ -148,14 +151,14 @@ jobs:
ppa.launchpadcontent.net:443
pypi.org:443
raw.githubusercontent.com:443
- uses: actions/[email protected]
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Install Eigen3
if: contains(matrix.tox-env, 'sbck')
run: |
sudo apt-get update
sudo apt-get install libeigen3-dev
- name: Set up Python${{ matrix.python-version }}
uses: actions/[email protected]
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
Expand All @@ -172,7 +175,7 @@ jobs:

test-conda:
needs: lint
name: test-conda-${{ matrix.tox-env }} (Python${{ matrix.python-version }})
name: test-conda-Python${{ matrix.python-version }}
if: |
contains(github.event.pull_request.labels.*.name, 'approved') ||
(github.event.review.state == 'approved') ||
Expand All @@ -181,8 +184,8 @@ jobs:
strategy:
matrix:
include:
- tox-env: py310
python-version: "3.10"
- python-version: "3.9"
- python-version: "3.12"
defaults:
run:
shell: bash -l {0}
Expand All @@ -203,9 +206,9 @@ jobs:
pypi.org:443
raw.githubusercontent.com:443
repo.anaconda.com:443
- uses: actions/[email protected]
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Setup Conda (Micromamba) with Python${{ matrix.python-version }}
uses: mamba-org/setup-micromamba@v1.7.3
uses: mamba-org/setup-micromamba@8767fb704bd78032e9392f0386bf46950bdd1194 # v1.8.0
with:
cache-downloads: true
cache-environment: true
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-mastodon.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ on:
default: true
type: boolean

permissions: # added using https://github.com/step-security/secure-repo
permissions:
contents: read

jobs:
Expand All @@ -30,7 +30,7 @@ jobs:
egress-policy: audit

- name: Checkout
uses: actions/[email protected]
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1

- name: Current Version
if: ${{ !github.event.inputs.version-tag }}
Expand Down Expand Up @@ -63,7 +63,7 @@ jobs:
- name: Prepare Message
id: render_template
uses: chuhlomin/[email protected]
uses: chuhlomin/render-template@a473db625a96c98e519d188812dc22bcaf54ffba # v1.9
with:
template: .github/publish-mastodon.template.md
vars: |
Expand All @@ -75,7 +75,7 @@ jobs:
- name: Send toot to Mastodon
if: ${{ github.event.inputs.dry-run != 'true' }} || ${{ github.event_name == 'release' }}
uses: cbrgm/[email protected]
uses: cbrgm/mastodon-github-action@d98ab3376f941df14d37d5737961de431c0838c6 # v1.0.3
with:
message: "${{ steps.render_template.outputs.result }}${{ env.contributors }}"
visibility: "public"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/publish-pypi.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ on:
types:
- published

permissions: # added using https://github.com/step-security/secure-repo
permissions:
contents: read

jobs:
Expand All @@ -21,9 +21,9 @@ jobs:
uses: step-security/harden-runner@eb238b55efaa70779f274895e782ed17c84f2895 # v2.6.1
with:
egress-policy: audit
- uses: actions/[email protected]
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- name: Set up Python3
uses: actions/[email protected]
uses: actions/setup-python@0a5c61591373683505ea898e09a3ea4f39ef2b9c # v5.0.0
with:
python-version: "3.x"
- name: Install packaging libraries
Expand All @@ -33,4 +33,4 @@ jobs:
run: |
python -m flit build
- name: Publish distribution 📦 to PyPI
uses: pypa/[email protected]
uses: pypa/gh-action-pypi-publish@2f6f737ca5f74c637829c0f5c3acd0e29ea5e8bf # v1.8.11
11 changes: 3 additions & 8 deletions .github/workflows/scorecard.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,8 @@ on:
schedule:
- cron: '41 8 * * 4'
push:
branches: [ "master" ]
branches:
- master

# Declare default permissions as read only.
permissions: read-all
Expand All @@ -26,9 +27,6 @@ jobs:
security-events: write
# Needed to publish results and get a badge (see publish_results below).
id-token: write
# Uncomment the permissions below if installing in a private repository.
# contents: read
# actions: read

steps:
- name: Harden Runner
Expand Down Expand Up @@ -56,15 +54,12 @@ jobs:
# - Publish results to OpenSSF REST API for easy access by consumers
# - Allows the repository to include the Scorecard badge.
# - See https://github.com/ossf/scorecard-action#publishing-results.
# For private repositories:
# - `publish_results` will always be set to `false`, regardless
# of the value entered here.
publish_results: true

# Upload the results as artifacts (optional). Commenting out will disable uploads of run results in SARIF
# format to the repository Actions tab.
- name: "Upload artifact"
uses: actions/upload-artifact@1eb3cb2b3e0f29609092a73eb033bb759a334595
uses: actions/upload-artifact@694cdabd8bdb0f10b2cea11669e1bf5453eed0a6
with:
name: SARIF file
path: results.sarif
Expand Down
Loading

0 comments on commit dc0348c

Please sign in to comment.