Skip to content

Commit a8d0dd8

Browse files
authored
Merge pull request #85 from MiraGeoscience/GEOPY-2161
GEOPY-2161: fix wrong regular expression
2 parents eaf2722 + 74bd16a commit a8d0dd8

6 files changed

Lines changed: 29 additions & 8 deletions

File tree

.github/workflows/issue_to_jira.yml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,10 +4,17 @@ on:
44
issues:
55
types: [opened]
66

7+
permissions:
8+
contents: read
9+
issues: write
10+
711
jobs:
812
call-workflow-create-jira-issue:
913
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-issue_to_jira.yml@main
10-
secrets: inherit
1114
with:
1215
project-key: 'GEOPY'
1316
components: '[{"name": "simpeg"}]'
17+
secrets:
18+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
19+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
20+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,16 @@
11
name: Add JIRA issue summary
22

33
on:
4-
pull_request_target:
4+
pull_request_target: # zizmor: ignore[dangerous-triggers]
55
types: [opened]
66

7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
711
jobs:
812
call-workflow-add-jira-issue-summary:
913
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_add_jira_summary.yml@main
10-
secrets: inherit
14+
secrets:
15+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
16+
JIRA_BASIC_AUTH: ${{ secrets.JIRA_BASIC_AUTH }}

.github/workflows/pull_request.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ jobs:
6868
persist-credentials: false
6969

7070
- name: flake8 review
71-
uses: reviewdog/action-flake8@v3
71+
uses: reviewdog/action-flake8@b65981e158319f08cb7d0132f28bc0081e110adc # v3.15.2
7272
with:
7373
workdir: pr_source
7474
github_token: ${{ secrets.GITHUB_TOKEN }}
@@ -104,7 +104,7 @@ jobs:
104104
path: 'pr_source'
105105
persist-credentials: false
106106

107-
- uses: reviewdog/action-black@v3
107+
- uses: reviewdog/action-black@644053a260402bc4278a865906107bd8aef7fae8 # v3.22.4
108108
with:
109109
workdir: 'pr_source'
110110
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/python_deploy_dev.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ jobs:
1313
call-workflow-conda-publish:
1414
name: Publish development conda package on JFrog Artifactory
1515
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_rattler_package.yml@main
16+
permissions:
17+
contents: write # to create draft release and attach artifacts
18+
actions: read
1619
with:
1720
package-name: 'mira-simpeg'
1821
python-version: '3.10'
@@ -25,6 +28,9 @@ jobs:
2528
call-workflow-pypi-publish:
2629
name: Publish development pypi package (JFrog Artifactory, TestPyPI)
2730
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@main
31+
permissions:
32+
contents: write # to create draft release and attach artifacts
33+
actions: read
2834
with:
2935
package-manager: 'setuptools'
3036
package-name: 'mira-simpeg'

.github/workflows/python_deploy_prod.yml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ concurrency:
2323
group: ${{ github.workflow }}-${{ github.event.release.tag_name || github.event.inputs.release-tag || github.run_id }}
2424
cancel-in-progress: true
2525

26+
permissions:
27+
contents: read
28+
actions: read
29+
2630
jobs:
2731
call-workflow-conda-release:
2832
name: Publish production Conda package on JFrog Artifactory

simpeg/directives/_save_geoh5.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -379,9 +379,7 @@ def write(self, iteration: int, **_):
379379
with open(dirpath / "SimPEG.log", "r", encoding="utf-8") as file:
380380
iteration = 0
381381
for line in file:
382-
val = re.findall(
383-
"[+\-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+\-]?\d+)", line # noqa
384-
)
382+
val = re.findall(r"[+-]?(?:0|[1-9]\d*)(?:\.\d*)?(?:[eE][+-]?\d+)", line)
385383
if len(val) == 5:
386384
log.append(val[:-2])
387385
iteration += 1

0 commit comments

Comments
 (0)