Skip to content

Commit b18f2f8

Browse files
authored
Merge pull request #27 from MiraGeoscience/DEVOPS-799
DEVOPS-799: add workflow for zizmor and apply recommendations
2 parents 35b2f5d + d8fca41 commit b18f2f8

6 files changed

Lines changed: 75 additions & 4 deletions

File tree

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,20 @@
11
name: Create JIRA issue
2+
permissions:
3+
contents: read
4+
issues: write
25

36
on:
47
issues:
58
types: [opened]
69

710
jobs:
811
call-workflow-create-jira-issue:
12+
if: startsWith(github.repository, 'MiraGeoscience/') # run on the Mira repo only
913
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-issue_to_jira.yml@main
10-
secrets: inherit
14+
secrets:
15+
JIRA_BASE_URL: ${{ secrets.JIRA_BASE_URL }}
16+
JIRA_API_TOKEN: ${{ secrets.JIRA_API_TOKEN }}
17+
JIRA_USER_EMAIL: ${{ secrets.JIRA_USER_EMAIL }}
1118
with:
1219
project-key: 'GEOPY'
1320
components: '[{"name": "grid-apps"}]'
Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,20 @@
11
name: Add JIRA issue summary
22

33
on:
4-
pull_request_target:
4+
pull_request:
55
types: [opened]
6+
permissions:
7+
contents: read
8+
pull-requests: write
69

710
jobs:
811
call-workflow-add-jira-issue-summary:
12+
if: startsWith(github.event.pull_request.head.repo.full_name, 'MiraGeoscience/') # run if PR originates from the Mira repo only
913
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-jira-pr_add_jira_summary.yml@main
10-
secrets: inherit
14+
permissions:
15+
contents: read
16+
pull-requests: write
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 }}

.github/workflows/python_analysis.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
name: Python analysis
2-
2+
permissions:
3+
contents: read
4+
pull-requests: read
35
on:
46
pull_request:
57
types: [opened, synchronize, reopened, ready_for_review]
@@ -25,18 +27,27 @@ jobs:
2527
call-workflow-static-analysis:
2628
name: Static analysis
2729
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-static_analysis.yml@main
30+
permissions:
31+
contents: read
32+
pull-requests: read
2833
with:
2934
package-manager: 'conda'
3035
app-name: 'grid_apps'
3136
python-version: '3.10'
3237
call-workflow-pre-commmit:
3338
name: Pre-Commit
3439
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-pre_commit.yml@main
40+
permissions:
41+
contents: read
42+
pull-requests: read
3543
with:
3644
app-name: 'grid_apps'
3745
call-workflow-pytest:
3846
name: Pytest
3947
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-pytest.yml@main
48+
permissions:
49+
contents: read
50+
pull-requests: read
4051
with:
4152
package-manager: 'conda'
4253
python-versions: '["3.10", "3.11", "3.12"]'

.github/workflows/python_deploy_dev.yml

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Deploy python package in development
22

3+
permissions:
4+
contents: read
5+
36
on:
47
push:
58
tags:
@@ -13,6 +16,9 @@ jobs:
1316
call-workflow-conda-publish:
1417
name: Publish development conda package on JFrog Artifactory
1518
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_rattler_package.yml@main
19+
permissions:
20+
contents: read
21+
id-token: write
1622
with:
1723
package-name: 'grid-apps'
1824
python-version: '3.10'
@@ -25,6 +31,8 @@ jobs:
2531
call-workflow-pypi-publish:
2632
name: Publish development pypi package (JFrog Artifactory)
2733
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-publish_pypi_package.yml@main
34+
permissions:
35+
contents: read
2836
with:
2937
package-manager: 'poetry'
3038
package-name: 'grid-apps'

.github/workflows/python_deploy_prod.yml

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
name: Deploy python package in production
22

3+
permissions:
4+
contents: read
5+
36
on:
47
release:
58
types: [published]
@@ -28,6 +31,9 @@ jobs:
2831
name: Publish production Conda package on JFrog Artifactory
2932
if: ${{ github.event_name == 'release' || github.event.inputs.publish-conda == 'true' }}
3033
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_conda_assets.yml@main
34+
permissions:
35+
contents: read
36+
id-token: write
3137
with:
3238
virtual-repo-names: '["geology-noremote-conda-prod", "geophysics-noremote-conda-prod"]'
3339
release-tag: ${{ github.event.release.tag_name || github.event.inputs.release-tag }}
@@ -38,6 +44,9 @@ jobs:
3844
name: Publish production PyPI package (JFrog Artifactory)
3945
if: ${{ github.event_name == 'release' || github.event.inputs.publish-pypi == 'true' }}
4046
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-python-release_pypi_assets.yml@main
47+
permissions:
48+
contents: read
49+
id-token: write
4150
with:
4251
package-name: 'grid-apps'
4352
virtual-repo-names: '["geology-pypi-prod", "geophysics-pypi-prod"]'
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
name: Zizmor analysis
2+
3+
on:
4+
pull_request:
5+
types: [opened, synchronize, reopened, ready_for_review]
6+
branches:
7+
- develop
8+
- main
9+
- release/**
10+
- feature/**
11+
- hotfix/**
12+
push:
13+
branches:
14+
- main
15+
- develop
16+
- feature/**
17+
- hotfix/**
18+
- release/**
19+
20+
jobs:
21+
call-workflow-zizmor:
22+
name: Zizmor analysis
23+
permissions:
24+
contents: read
25+
actions: read
26+
uses: MiraGeoscience/CI-tools/.github/workflows/reusable-zizmor-security.yml@main

0 commit comments

Comments
 (0)