saltext.openscap 0.1.0__tar.gz → 0.2.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (122) hide show
  1. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.copier-answers.yml +10 -3
  2. saltext_openscap-0.2.0/.envrc.example +31 -0
  3. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.github/ISSUE_TEMPLATE/config.yml +2 -2
  4. saltext_openscap-0.2.0/.github/actions/upload-exitstatus/action.yml +33 -0
  5. saltext_openscap-0.2.0/.github/workflows/ci.yml +64 -0
  6. saltext_openscap-0.2.0/.github/workflows/clear-caches.yml +36 -0
  7. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.github/workflows/deploy-docs-action.yml +26 -19
  8. saltext_openscap-0.2.0/.github/workflows/deploy-package-action.yml +211 -0
  9. saltext_openscap-0.2.0/.github/workflows/docs-action.yml +103 -0
  10. saltext_openscap-0.2.0/.github/workflows/finalize-release.yml +238 -0
  11. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.github/workflows/get-changed-files.yml +23 -11
  12. saltext_openscap-0.2.0/.github/workflows/initiate-release.yml +319 -0
  13. saltext_openscap-0.2.0/.github/workflows/package-action.yml +59 -0
  14. saltext_openscap-0.2.0/.github/workflows/pr.yml +32 -0
  15. saltext_openscap-0.2.0/.github/workflows/pre-commit-action.yml +82 -0
  16. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.github/workflows/prepare-release-action.yml +34 -18
  17. saltext_openscap-0.2.0/.github/workflows/push.yml +114 -0
  18. saltext_openscap-0.2.0/.github/workflows/set-resolution-action.yml +46 -0
  19. saltext_openscap-0.2.0/.github/workflows/tag-auto.yml +120 -0
  20. saltext_openscap-0.2.0/.github/workflows/tag.yml +87 -0
  21. saltext_openscap-0.2.0/.github/workflows/test-action.yml +137 -0
  22. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.gitignore +1 -0
  23. saltext_openscap-0.2.0/.pre-commit-config.yaml +247 -0
  24. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.pre-commit-hooks/check-cli-examples.py +21 -9
  25. saltext_openscap-0.2.0/.pre-commit-hooks/make-autodocs.py +315 -0
  26. saltext_openscap-0.2.0/CHANGELOG.md +22 -0
  27. saltext_openscap-0.2.0/CODE-OF-CONDUCT.md +134 -0
  28. saltext_openscap-0.2.0/CONTRIBUTING.md +17 -0
  29. saltext_openscap-0.2.0/Makefile +85 -0
  30. saltext_openscap-0.2.0/PKG-INFO +145 -0
  31. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/README.md +55 -44
  32. saltext_openscap-0.2.0/docs/changelog.md +14 -0
  33. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/conf.py +3 -15
  34. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/topics/installation.md +12 -3
  35. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/noxfile.py +217 -238
  36. saltext_openscap-0.2.0/pyproject.toml +357 -0
  37. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/src/saltext/openscap/__init__.py +5 -2
  38. saltext_openscap-0.2.0/src/saltext/openscap/modules/openscap.py +259 -0
  39. saltext_openscap-0.2.0/src/saltext/openscap/version.py +1 -0
  40. saltext_openscap-0.2.0/src/saltext.openscap.egg-info/PKG-INFO +145 -0
  41. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/src/saltext.openscap.egg-info/SOURCES.txt +12 -5
  42. saltext_openscap-0.2.0/src/saltext.openscap.egg-info/requires.txt +3 -0
  43. saltext_openscap-0.2.0/src/saltext.openscap.egg-info/scm_file_list.json +84 -0
  44. saltext_openscap-0.2.0/src/saltext.openscap.egg-info/scm_version.json +8 -0
  45. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/functional/conftest.py +3 -1
  46. saltext_openscap-0.2.0/tests/unit/modules/test_openscap.py +594 -0
  47. saltext_openscap-0.2.0/tools/coverage_dev.py +87 -0
  48. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tools/helpers/cmd.py +58 -14
  49. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tools/helpers/copier.py +19 -5
  50. saltext_openscap-0.2.0/tools/helpers/pre_commit.py +276 -0
  51. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tools/helpers/prompt.py +2 -2
  52. saltext_openscap-0.2.0/tools/helpers/venv.py +302 -0
  53. saltext_openscap-0.2.0/tools/hook_group.py +26 -0
  54. saltext_openscap-0.2.0/tools/initialize.py +54 -0
  55. saltext_openscap-0.2.0/tools/pre_commit_quiet.py +23 -0
  56. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tools/version.py +2 -0
  57. saltext_openscap-0.1.0/.coveragerc +0 -44
  58. saltext_openscap-0.1.0/.envrc.example +0 -7
  59. saltext_openscap-0.1.0/.github/ISSUE_TEMPLATE.md +0 -11
  60. saltext_openscap-0.1.0/.github/workflows/ci.yml +0 -175
  61. saltext_openscap-0.1.0/.github/workflows/deploy-package-action.yml +0 -60
  62. saltext_openscap-0.1.0/.github/workflows/docs-action.yml +0 -58
  63. saltext_openscap-0.1.0/.github/workflows/package-action.yml +0 -64
  64. saltext_openscap-0.1.0/.github/workflows/pr.yml +0 -56
  65. saltext_openscap-0.1.0/.github/workflows/pre-commit-action.yml +0 -56
  66. saltext_openscap-0.1.0/.github/workflows/tag.yml +0 -128
  67. saltext_openscap-0.1.0/.github/workflows/test-action.yml +0 -99
  68. saltext_openscap-0.1.0/.pre-commit-config.yaml +0 -146
  69. saltext_openscap-0.1.0/.pre-commit-hooks/make-autodocs.py +0 -123
  70. saltext_openscap-0.1.0/.pylintrc +0 -692
  71. saltext_openscap-0.1.0/CHANGELOG.md +0 -9
  72. saltext_openscap-0.1.0/CODE-OF-CONDUCT.md +0 -127
  73. saltext_openscap-0.1.0/CONTRIBUTING.md +0 -14
  74. saltext_openscap-0.1.0/Makefile +0 -58
  75. saltext_openscap-0.1.0/PKG-INFO +0 -158
  76. saltext_openscap-0.1.0/docs/changelog.md +0 -12
  77. saltext_openscap-0.1.0/pyproject.toml +0 -193
  78. saltext_openscap-0.1.0/setup.py +0 -5
  79. saltext_openscap-0.1.0/src/saltext/openscap/modules/openscap.py +0 -89
  80. saltext_openscap-0.1.0/src/saltext/openscap/version.py +0 -1
  81. saltext_openscap-0.1.0/src/saltext.openscap.egg-info/PKG-INFO +0 -158
  82. saltext_openscap-0.1.0/src/saltext.openscap.egg-info/not-zip-safe +0 -1
  83. saltext_openscap-0.1.0/src/saltext.openscap.egg-info/requires.txt +0 -35
  84. saltext_openscap-0.1.0/tests/unit/modules/test_openscap.py +0 -212
  85. saltext_openscap-0.1.0/tools/helpers/pre_commit.py +0 -115
  86. saltext_openscap-0.1.0/tools/helpers/venv.py +0 -108
  87. saltext_openscap-0.1.0/tools/initialize.py +0 -26
  88. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.codecov.yml +0 -0
  89. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.github/ISSUE_TEMPLATE/bug_report.md +0 -0
  90. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.github/ISSUE_TEMPLATE/docs.md +0 -0
  91. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.github/ISSUE_TEMPLATE/feature_request.md +0 -0
  92. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.github/ISSUE_TEMPLATE/tech-debt.md +0 -0
  93. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/.github/PULL_REQUEST_TEMPLATE.md +0 -0
  94. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/LICENSE +0 -0
  95. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/NOTICE +0 -0
  96. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/changelog/.template.jinja +0 -0
  97. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/Makefile +0 -0
  98. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/_ext/saltdomain.py +0 -0
  99. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/_static/.gitkeep +0 -0
  100. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/index.rst +0 -0
  101. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/make.bat +0 -0
  102. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/ref/.gitkeep +0 -0
  103. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/ref/modules/index.rst +0 -0
  104. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/ref/modules/saltext.openscap.modules.openscap.rst +0 -0
  105. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/docs/sitevars.rst +0 -0
  106. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/setup.cfg +0 -0
  107. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/src/saltext/openscap/modules/__init__.py +0 -0
  108. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/src/saltext.openscap.egg-info/dependency_links.txt +0 -0
  109. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/src/saltext.openscap.egg-info/entry_points.txt +0 -0
  110. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/src/saltext.openscap.egg-info/top_level.txt +0 -0
  111. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/__init__.py +0 -0
  112. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/conftest.py +0 -0
  113. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/functional/__init__.py +0 -0
  114. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/functional/modules/__init__.py +0 -0
  115. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/integration/__init__.py +0 -0
  116. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/integration/conftest.py +0 -0
  117. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/integration/modules/__init__.py +0 -0
  118. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/unit/__init__.py +0 -0
  119. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/unit/conftest.py +0 -0
  120. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tests/unit/modules/__init__.py +0 -0
  121. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tools/helpers/__init__.py +0 -0
  122. {saltext_openscap-0.1.0 → saltext_openscap-0.2.0}/tools/helpers/git.py +0 -0
@@ -1,6 +1,6 @@
1
1
  # Autogenerated. Do not edit this by hand, use `copier update`.
2
2
  ---
3
- _commit: 0.8.0
3
+ _commit: 0.11.0
4
4
  _src_path: https://github.com/salt-extensions/salt-extension-copier
5
5
  author: Marek Czernek
6
6
  author_email: marek.czernek@suse.com
@@ -10,15 +10,18 @@ deploy_docs: never
10
10
  docs_url: ''
11
11
  integration_name: Openscap
12
12
  license: apache
13
+ linux_test_distros:
14
+ - Ubuntu
13
15
  loaders:
14
16
  - module
15
- max_salt_version: '3007'
17
+ max_salt_version: '3008'
16
18
  no_saltext_namespace: false
17
19
  os_support:
18
20
  - Linux
19
21
  package_name: openscap
20
22
  project_name: openscap
21
- python_requires: '3.10'
23
+ push_secret: ''
24
+ python_requires: '3.11'
22
25
  relax_pylint: true
23
26
  salt_version: '3006'
24
27
  source_url: https://github.com/m-czernek/saltext-openscap
@@ -26,4 +29,8 @@ ssh_fixtures: true
26
29
  summary: Salt Extension for interacting with Openscap
27
30
  test_containers: false
28
31
  tracker_url: https://bugzilla.opensuse.org
32
+ typing: false
33
+ ubuntu_releases:
34
+ - '26.04'
29
35
  url: https://github.com/m-czernek/saltext-openscap
36
+ venv_python: '3.14'
@@ -0,0 +1,31 @@
1
+ layout_saltext() {
2
+ # --skip-install only installs the project when the venv is freshly
3
+ # created or pyproject.toml changed since the last install.
4
+ # Run `make dev` to force a full synchronization.
5
+ VIRTUAL_ENV="$(python3 tools/initialize.py --skip-install --print-venv)"
6
+ PATH_add "$VIRTUAL_ENV/bin"
7
+ export VIRTUAL_ENV
8
+ }
9
+
10
+ # Uncomment to override the Python version for the development venv,
11
+ # e.g. when the configured `venv_python` is hard to come by locally:
12
+ # export VENV_PYTHON=3.13
13
+
14
+ # Uncomment to inherit system-wide packages in the development venvs,
15
+ # e.g. when dependencies are only available as system packages:
16
+ # export VENV_SYSTEM_SITE_PACKAGES=1
17
+
18
+ # Uncomment to skip the actionlint hook locally when it cannot be built,
19
+ # e.g. for lack of a Go toolchain. It still runs in CI. Multiple hooks
20
+ # can be specified as a comma-separated list. Other candidates for skipping
21
+ # on specific platforms are:
22
+ # * ty: Only auto-installed on Windows/Linux/macOS. On other platforms,
23
+ # requires a locally installed `uv` binary and Rust toolchain since
24
+ # no binary wheels are available for them.
25
+ # * zizmor: Only required on Windows/Linux/macOS, other platforms skip it
26
+ # automatically when not installed via external means.
27
+ # Requires a Rust toolchain in case no binary wheels are available for
28
+ # the architecture an otherwise supported OS runs on.
29
+ # export SKIP=actionlint
30
+
31
+ layout_saltext
@@ -10,5 +10,5 @@ contact_links:
10
10
  url: https://web.libera.chat/#salt
11
11
  about: Please ask and answer questions here.
12
12
  - name: Security vulnerabilities
13
- email: saltproject-security.pdl@broadcom.com
14
- about: Please report security vulnerabilities here.
13
+ url: https://github.com/saltstack/salt/blob/master/SECURITY.md
14
+ about: Please report security vulnerabilities to saltproject-security.pdl@broadcom.com.
@@ -0,0 +1,33 @@
1
+ ---
2
+ name: upload-exitstatus
3
+ description: Upload a job's status as an artifact
4
+ inputs:
5
+ artifact_prefix:
6
+ required: false
7
+ default: exitstatus-
8
+ name:
9
+ required: false
10
+ default: ''
11
+
12
+ runs:
13
+ using: composite
14
+
15
+ steps:
16
+
17
+ - name: Set Exit Status
18
+ if: ${{ !cancelled() }}
19
+ env:
20
+ JOB_STATUS: ${{ job.status }}
21
+ OUTFILE: exitstatus/${{ inputs.name == '' && github.job || inputs.name }}
22
+ shell: bash
23
+ run: |
24
+ mkdir exitstatus
25
+ echo "${JOB_STATUS}" > "$OUTFILE"
26
+
27
+ - name: Upload Exit Status
28
+ if: ${{ !cancelled() }}
29
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
30
+ with:
31
+ name: ${{ inputs.artifact_prefix }}${{ inputs.name == '' && github.job || inputs.name }}
32
+ path: exitstatus
33
+ if-no-files-found: error
@@ -0,0 +1,64 @@
1
+ ---
2
+ name: CI
3
+
4
+ on:
5
+ workflow_call:
6
+ inputs:
7
+ checkout-ref:
8
+ required: false
9
+ type: string
10
+ default: ''
11
+
12
+ permissions: {}
13
+
14
+ jobs:
15
+ get-changed-files:
16
+ name: Get Changed Files
17
+ uses: $/.github/workflows/get-changed-files.yml
18
+ with:
19
+ checkout-ref: ${{ inputs.checkout-ref || github.sha }}
20
+ permissions:
21
+ contents: read
22
+ pull-requests: read # for dorny/paths-filter to read pull requests
23
+
24
+ pre-commit:
25
+ name: Pre-Commit
26
+ needs:
27
+ - get-changed-files
28
+ uses: $/.github/workflows/pre-commit-action.yml
29
+ with:
30
+ changed-files: ${{ needs.get-changed-files.outputs.changed-files }}
31
+ checkout-ref: ${{ inputs.checkout-ref || github.sha }}
32
+ permissions:
33
+ contents: read
34
+
35
+ test:
36
+ name: Test
37
+ needs:
38
+ - pre-commit
39
+ uses: $/.github/workflows/test-action.yml
40
+ with:
41
+ checkout-ref: ${{ inputs.checkout-ref || github.sha }}
42
+ permissions:
43
+ contents: read
44
+ id-token: write # codecov uploads
45
+
46
+ docs:
47
+ name: Docs
48
+ needs:
49
+ - pre-commit
50
+ uses: $/.github/workflows/docs-action.yml
51
+ with:
52
+ checkout-ref: ${{ inputs.checkout-ref || github.sha }}
53
+ permissions:
54
+ contents: read
55
+
56
+ build-python-package:
57
+ name: Python Package
58
+ needs:
59
+ - pre-commit
60
+ uses: $/.github/workflows/package-action.yml
61
+ with:
62
+ checkout-ref: ${{ inputs.checkout-ref || github.sha }}
63
+ permissions:
64
+ contents: read
@@ -0,0 +1,36 @@
1
+ ---
2
+ name: Clear Actions Caches
3
+
4
+ on:
5
+ workflow_dispatch:
6
+ inputs:
7
+ key:
8
+ description: Only delete the cache with this key. Deletes all caches when empty.
9
+ required: false
10
+ type: string
11
+ default: ""
12
+
13
+ concurrency:
14
+ group: ${{ github.workflow }}-${{ github.ref }}
15
+ cancel-in-progress: true
16
+
17
+ permissions: {}
18
+
19
+ jobs:
20
+ clear-caches:
21
+ name: Clear Actions Caches
22
+ runs-on: ubuntu-26.04
23
+ permissions:
24
+ actions: write # Delete caches
25
+
26
+ steps:
27
+ - name: Clear caches
28
+ env:
29
+ GH_TOKEN: ${{ github.token }}
30
+ KEY: ${{ inputs.key }}
31
+ run: |
32
+ if [ -n "$KEY" ]; then
33
+ gh cache delete --repo "$GITHUB_REPOSITORY" -- "$KEY"
34
+ else
35
+ gh cache delete --repo "$GITHUB_REPOSITORY" --all --succeed-on-no-caches
36
+ fi
@@ -10,6 +10,15 @@ on:
10
10
  type: string
11
11
  required: false
12
12
  default: html-docs
13
+ # The workflow run that hosts the docs artifact. Defaults to
14
+ # the triggering run (`workflow_run` trigger) or the current one.
15
+ run-id:
16
+ type: string
17
+ required: false
18
+ default: ''
19
+
20
+
21
+ permissions: {}
13
22
 
14
23
  jobs:
15
24
 
@@ -32,47 +41,45 @@ jobs:
32
41
  url: ${{ steps.deployment.outputs.page_url }}
33
42
 
34
43
  permissions:
35
- pages: write
36
- id-token: write
44
+ actions: read # Download artifacts of other runs when called via workflow_run trigger
45
+ id-token: write # Pages deployment
46
+ pages: write # Pages deployment
37
47
 
38
- runs-on: ubuntu-24.04
48
+ runs-on: ubuntu-26.04
39
49
 
40
50
  steps:
51
+
41
52
  - name: Download built docs
42
- uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7.0.0
53
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
43
54
  with:
44
55
  name: ${{ inputs.artifact-name }}
45
56
  path: html-docs
57
+ github-token: ${{ github.token }}
58
+ run-id: ${{ inputs.run-id || github.event_name == 'workflow_run' && github.event.workflow_run.id || github.run_id }}
46
59
 
47
60
  - name: Upload GitHub Pages artifact
48
- uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # v4.0.0
61
+ uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
49
62
  with:
50
63
  name: html-docs-pages
51
64
  path: html-docs
52
65
 
53
66
  - name: Deploy to GitHub Pages
54
67
  id: deployment
55
- uses: actions/deploy-pages@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4.0.5
68
+ uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1
56
69
  with:
57
70
  artifact_name: html-docs-pages
58
71
 
59
72
  - name: Delete GitHub Pages artifact
60
- if: always()
61
- uses: geekyeggo/delete-artifact@7ee91e82b4a7f3339cd8b14beace3d826a2aac39 # v5.1.0
73
+ if: ${{ !cancelled() }}
74
+ uses: geekyeggo/delete-artifact@176a747ab7e287e3ff4787bf8a148716375ca118 # v6.0.0
62
75
  with:
63
76
  name: html-docs-pages
64
77
  failOnError: false
65
78
 
66
- - name: Set Exit Status
67
- if: always()
68
- run: |
69
- mkdir exitstatus
70
- echo "${{ job.status }}" > exitstatus/${{ github.job }}
79
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
80
+ with:
81
+ persist-credentials: false
71
82
 
72
83
  - name: Upload Exit Status
73
- if: always()
74
- uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6.0.0
75
- with:
76
- name: exitstatus-${{ github.job }}
77
- path: exitstatus
78
- if-no-files-found: error
84
+ if: ${{ !cancelled() }}
85
+ uses: $/.github/actions/upload-exitstatus
@@ -0,0 +1,211 @@
1
+ # Publishes verified Python distributions to PyPI.
2
+ #
3
+ # This workflow is registered as the PyPI Trusted Publisher.
4
+ # Any job in this file with `id-token: write` and the configured
5
+ # environment can potentially obtain PyPI publishing credentials.
6
+ #
7
+ # Only the publish job receives OIDC permissions.
8
+ # No repository code is executed in the publishing job.
9
+ #
10
+ # The triggering workflow must be initiate-release.yml, which
11
+ # independently authorizes releases and builds the artifacts.
12
+ # `workflow_run` workflows always execute the default branch's
13
+ # definition and artifacts can only be uploaded by a run itself,
14
+ # so verifying the triggering run's identity (path + event) makes
15
+ # its artifacts trustworthy.
16
+ ---
17
+ name: Release Salt Extension Python Package
18
+
19
+ on:
20
+ # zizmor: ignore[dangerous-triggers]
21
+ # `workflow_run` selects triggering runs by display name only, which a pull
22
+ # request can claim by adding a `pull_request`-triggered workflow of the same
23
+ # name. The trigger alone therefore grants no trust - the `verify` job below
24
+ # verifies the triggering run's provenance before anything is touched.
25
+ workflow_run:
26
+ types:
27
+ - completed
28
+ workflows:
29
+ - Initiate Release
30
+
31
+ concurrency:
32
+ group: ${{ github.workflow }}
33
+ cancel-in-progress: false
34
+ queue: max
35
+
36
+ cache-mode: none
37
+ permissions: {}
38
+
39
+ jobs:
40
+ verify:
41
+ name: Verify release
42
+ runs-on: ubuntu-26.04
43
+
44
+ # Only accept successful runs of the actual release initiation workflow,
45
+ # identified by its file path and trigger, never by name alone. A pull
46
+ # request cannot forge the `workflow_run` event: such workflows only ever
47
+ # execute the default branch's definition.
48
+ if: >-
49
+ github.event.workflow_run.conclusion == 'success' &&
50
+ github.event.workflow_run.repository.full_name == github.repository &&
51
+ github.event.workflow_run.head_repository.full_name == github.repository &&
52
+ github.event.workflow_run.event == 'workflow_run' &&
53
+ github.event.workflow_run.path == '.github/workflows/initiate-release.yml' &&
54
+ github.event.workflow_run.head_branch == github.event.repository.default_branch
55
+
56
+ permissions:
57
+ actions: read # List release artifacts and download them from different run
58
+ contents: read # Resolve the release tag via the API
59
+
60
+ env:
61
+ GH_TOKEN: ${{ github.token }}
62
+ GH_REPO: ${{ github.repository }}
63
+ INITIATE_RUN_ID: ${{ github.event.workflow_run.id }}
64
+
65
+ outputs:
66
+ version: ${{ steps.manifest.outputs.version }}
67
+ commit: ${{ steps.manifest.outputs.commit }}
68
+ tag: ${{ steps.manifest.outputs.tag }}
69
+
70
+ steps:
71
+ # The triggering workflow also completes successfully when all its
72
+ # jobs were skipped, e.g. because it was triggered by an unrelated
73
+ # or unauthorized workflow run. In that case, there is no release.
74
+ - name: Check triggering workflow for release manifest
75
+ id: check
76
+ run: |
77
+ set -euo pipefail
78
+
79
+ artifacts="$(gh api --paginate \
80
+ "repos/${GH_REPO}/actions/runs/${INITIATE_RUN_ID}/artifacts?per_page=100" \
81
+ --jq '.artifacts[] | select(.expired == false).name')"
82
+
83
+ if grep -qx 'release-manifest' <<< "$artifacts"; then
84
+ echo "available=1" >> "$GITHUB_OUTPUT"
85
+ else
86
+ echo "available=0" >> "$GITHUB_OUTPUT"
87
+ echo "::notice::No release manifest found, assuming the triggering run did not initiate a release."
88
+ fi
89
+
90
+ - name: Download release manifest
91
+ if: steps.check.outputs.available == '1'
92
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
93
+ with:
94
+ name: release-manifest
95
+ run-id: ${{ github.event.workflow_run.id }}
96
+ github-token: ${{ github.token }}
97
+ path: ${{ runner.temp }}/release
98
+
99
+ - name: Verify release manifest
100
+ if: steps.check.outputs.available == '1'
101
+ id: manifest
102
+ env:
103
+ MANIFEST: ${{ runner.temp }}/release/manifest.json
104
+ run: |
105
+ set -euo pipefail
106
+
107
+ # The manifest must describe a release initiated by the exact
108
+ # triggering run.
109
+ jq -e \
110
+ --arg repo "$GH_REPO" \
111
+ --argjson run_id "$INITIATE_RUN_ID" '
112
+ .schema_version == 1
113
+ and .repository == $repo
114
+ and .initiate_run_id == $run_id
115
+ and (.version | type == "string")
116
+ and (.tag | type == "string")
117
+ and (.commit | type == "string")
118
+ ' "$MANIFEST" > /dev/null
119
+
120
+ version="$(jq -er '.version' "$MANIFEST")"
121
+ tag="$(jq -er '.tag' "$MANIFEST")"
122
+ commit="$(jq -er '.commit' "$MANIFEST")"
123
+
124
+ # Validate release naming.
125
+ [[ "$version" =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]] || exit 1
126
+ [[ "$tag" == "v${version}" ]] || exit 1
127
+
128
+ # Require a complete commit SHA.
129
+ [[ "$commit" =~ ^[0-9a-f]{40}$ ]] || exit 1
130
+
131
+ # Retrieve the exact Git reference.
132
+ ref="$(gh api "repos/${GH_REPO}/git/ref/tags/${tag}")"
133
+
134
+ [[ "$(jq -r '.ref' <<< "$ref")" == "refs/tags/${tag}" ]] || {
135
+ echo "::error::Unexpected Git reference"
136
+ exit 1
137
+ }
138
+
139
+ sha="$(jq -er '.object.sha' <<< "$ref")"
140
+ type="$(jq -er '.object.type' <<< "$ref")"
141
+
142
+ # Dereference annotated tags.
143
+ for _ in 1 2 3 4; do
144
+ [[ "$type" == "tag" ]] || break
145
+
146
+ object="$(gh api "repos/${GH_REPO}/git/tags/${sha}")"
147
+ sha="$(jq -er '.object.sha' <<< "$object")"
148
+ type="$(jq -er '.object.type' <<< "$object")"
149
+ done
150
+
151
+ [[ "$type" == "commit" ]] || {
152
+ echo "::error::Release tag does not resolve to a commit"
153
+ exit 1
154
+ }
155
+
156
+ # The release tag must still reference the authorized commit.
157
+ [[ "$sha" == "$commit" ]] || {
158
+ echo "::error::Release tag has changed since initiation"
159
+ exit 1
160
+ }
161
+
162
+ echo "Verified release: $tag ($commit)"
163
+
164
+ {
165
+ echo "version=$version"
166
+ echo "tag=$tag"
167
+ echo "commit=$commit"
168
+ } >> "$GITHUB_OUTPUT"
169
+
170
+ - name: Upload release handoff
171
+ # Consumed by finalize-release.yml, which handles the
172
+ # remaining release steps after the packages were published.
173
+ if: steps.check.outputs.available == '1'
174
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
175
+ with:
176
+ name: release-handoff
177
+ path: ${{ runner.temp }}/release/manifest.json
178
+ if-no-files-found: error
179
+
180
+ publish:
181
+ name: Publish to PyPI
182
+ needs: verify
183
+ runs-on: ubuntu-26.04
184
+ # Skip when the triggering workflow did not initiate a release.
185
+ if: needs.verify.outputs.version != ''
186
+
187
+ environment:
188
+ name: release
189
+ url: https://pypi.org/p/saltext.openscap
190
+
191
+ permissions:
192
+ actions: read # Download artifact from the triggering run
193
+ id-token: write # Trusted Publishing
194
+
195
+ steps:
196
+ - name: Download verified distributions
197
+ uses: actions/download-artifact@9000827ccba6bdab643e8b6fd33ac0654aef8333 # v8.0.2
198
+ with:
199
+ name: salt-extension-packages
200
+ run-id: ${{ github.event.workflow_run.id }}
201
+ github-token: ${{ github.token }}
202
+ path: dist/
203
+
204
+ - name: Publish distributions to PyPI
205
+ uses: pypa/gh-action-pypi-publish@7245906fb61fa33a13554f9d5fb856fe61758086 # v1.14.3
206
+ with:
207
+ attestations: true
208
+ verbose: ${{ runner.debug == '1' }}
209
+
210
+ # The GitHub release and the docs deployment run separately on
211
+ # `workflow_run` in finalize-release.yml.
@@ -0,0 +1,103 @@
1
+ ---
2
+ name: Build Documentation
3
+
4
+ on:
5
+ workflow_call:
6
+ inputs:
7
+ checkout-ref:
8
+ required: false
9
+ type: string
10
+ default: ''
11
+ pages-artifact:
12
+ required: false
13
+ type: boolean
14
+ default: false
15
+ require-in-branch:
16
+ required: false
17
+ type: string
18
+ default: ''
19
+
20
+ permissions:
21
+ contents: read
22
+
23
+ jobs:
24
+ Docs:
25
+ name: Build Docs and Upload Artifact
26
+ runs-on: ubuntu-26.04
27
+ timeout-minutes: 10
28
+
29
+ steps:
30
+ - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
31
+ with:
32
+ ref: ${{ inputs.checkout-ref || github.sha }}
33
+ fetch-depth: 0
34
+ persist-credentials: false
35
+
36
+ - name: Enforce ref being in branch
37
+ if: ${{ inputs.require-in-branch != '' }}
38
+ env:
39
+ BRANCH_NAME: ${{ inputs.require-in-branch }}
40
+ CHECK_REF: ${{ inputs.checkout-ref || github.sha }}
41
+ run: git merge-base --is-ancestor "$CHECK_REF" "origin/$BRANCH_NAME"
42
+
43
+ - name: Set up Python 3.14 For Nox
44
+ uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
45
+ with:
46
+ python-version: "3.14"
47
+
48
+ - name: Install Nox
49
+ run: |
50
+ pip install "nox==${NOX_VERSION}" "uv==${UV_VERSION}"
51
+ env:
52
+ NOX_VERSION: '2026.10.20'
53
+ UV_VERSION: '0.13.5'
54
+
55
+ - name: Install Doc Requirements
56
+ run: |
57
+ nox --force-color -e docs --install-only
58
+
59
+ - name: Build Docs
60
+ env:
61
+ SKIP_REQUIREMENTS_INSTALL: '1'
62
+ run: |
63
+ nox --force-color -e docs
64
+
65
+ # Create a Pages-compatible artifact if we're going to deploy it
66
+ - name: Package documentation
67
+ if: inputs.pages-artifact
68
+ env:
69
+ DOCS_DIR: ${{ github.workspace }}/docs/_build/html
70
+ run: |
71
+ set -euo pipefail
72
+
73
+ test -f "$DOCS_DIR/index.html"
74
+ mkdir -p "$RUNNER_TEMP/docs"
75
+ tar \
76
+ --dereference \
77
+ --hard-dereference \
78
+ --directory "$DOCS_DIR" \
79
+ --exclude=.git \
80
+ --exclude=.github \
81
+ --exclude='.[^/]*' \
82
+ -cf "$RUNNER_TEMP/docs/artifact.tar" \
83
+ .
84
+
85
+ - name: Upload built docs as Pages artifact
86
+ if: inputs.pages-artifact
87
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
88
+ with:
89
+ name: html-docs
90
+ path: ${{ runner.temp }}/docs/artifact.tar
91
+ if-no-files-found: error
92
+ retention-days: 7
93
+
94
+ - name: Upload built docs as artifact
95
+ if: ${{ !inputs.pages-artifact }}
96
+ uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
97
+ with:
98
+ name: html-docs
99
+ path: docs/_build/html
100
+
101
+ - name: Upload Exit Status
102
+ if: ${{ !cancelled() }}
103
+ uses: $/.github/actions/upload-exitstatus