-
Notifications
You must be signed in to change notification settings - Fork 0
ci: add standard GitHub Actions workflows #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,15 @@ | ||
| name: Build Tests | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev, master, main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| build: | ||
| uses: OpenVoiceOS/gh-automations/.github/workflows/build-tests.yml@dev | ||
| secrets: inherit | ||
| with: | ||
| python_versions: '["3.10", "3.11", "3.12", "3.13"]' | ||
| install_extras: 'test,ovos' | ||
| test_path: 'test' |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,10 @@ | ||||||
| # auto add labels to PRs | ||||||
| on: | ||||||
| pull_request_target: | ||||||
| types: [ opened, edited ] | ||||||
| name: conventional-release-labels | ||||||
| jobs: | ||||||
| label: | ||||||
| runs-on: ubuntu-latest | ||||||
| steps: | ||||||
| - uses: bcoe/conventional-release-labels@v1 | ||||||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
# Resolve current v1 tag of bcoe/conventional-release-labels to a commit SHA
gh api repos/bcoe/conventional-release-labels/git/refs/tags/v1 --jq '.object'
gh api repos/bcoe/conventional-release-labels/releases --jq '.[0:3] | .[] | {tag_name, published_at}'Repository: TigreGotico/markovonnx Length of output: 430 🏁 Script executed: #!/bin/bash
set -euo pipefail
# 1) Confirm the targeted workflow line
echo "---- workflow snippet ----"
sed -n '1,80p' .github/workflows/conventional-label.yaml
# 2) Resolve the tag object returned for refs/tags/v1 to the underlying commit SHA
echo "---- resolve tag object -> commit ----"
gh api repos/bcoe/conventional-release-labels/git/tags/b503ca473654e07521c051628c5f1f969e7436da --jq '{sha: .object.sha, object_type: .object.type, tag: .tag}'
# Also resolve tags/v1.3.1, to ensure it matches
echo "---- resolve v1.3.1 tag -> commit ----"
gh api repos/bcoe/conventional-release-labels/git/refs/tags/v1.3.1 --jq '.object'
EOFRepository: TigreGotico/markovonnx Length of output: 728 Pin This workflow runs on Suggested change- - uses: bcoe/conventional-release-labels@v1
+ - uses: bcoe/conventional-release-labels@886f696738527c7be444262c327c89436dfb95a8 # v1.3.1📝 Committable suggestion
Suggested change
🧰 Tools🪛 zizmor (1.25.2)[error] 10-10: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) 🤖 Prompt for AI Agents |
||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| name: Code Coverage | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| coverage: | ||
| uses: OpenVoiceOS/gh-automations/.github/workflows/coverage.yml@dev | ||
| secrets: inherit | ||
| with: | ||
| python_version: '3.11' | ||
| coverage_source: 'markovonnx' | ||
| install_extras: '-e .[test,ovos]' | ||
| test_path: 'test' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| name: License Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| license_check: | ||
| uses: OpenVoiceOS/gh-automations/.github/workflows/license-check.yml@dev | ||
| secrets: inherit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,20 @@ | ||
| name: Lint | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev, master, main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| lint: | ||
| runs-on: ubuntu-latest | ||
| continue-on-error: true | ||
| steps: | ||
| - uses: actions/checkout@v4 | ||
| - uses: actions/setup-python@v5 | ||
| with: | ||
| python-version: '3.11' | ||
| - name: Install ruff | ||
| run: pip install ruff | ||
| - name: Run ruff | ||
| run: ruff check . || true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: OPM Check | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev, master, main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| opm_check: | ||
| uses: OpenVoiceOS/gh-automations/.github/workflows/opm-check.yml@dev | ||
| secrets: inherit | ||
| with: | ||
| plugin_type: 'auto' |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,11 @@ | ||
| name: PIP Audit | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| pip_audit: | ||
| uses: OpenVoiceOS/gh-automations/.github/workflows/pip-audit.yml@dev | ||
| secrets: inherit |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,17 @@ | ||
| name: Publish Stable Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| types: [closed] | ||
| branches: [master, main] | ||
|
|
||
| jobs: | ||
| publish_stable: | ||
| if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | ||
| uses: OpenVoiceOS/gh-automations/.github/workflows/publish-stable.yml@dev | ||
| secrets: inherit | ||
| with: | ||
| version_file: 'markovonnx/version.py' | ||
| publish_pypi: true | ||
| notify_matrix: true |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,14 @@ | ||
| name: Release Preview | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| release_preview: | ||
| uses: OpenVoiceOS/gh-automations/.github/workflows/release-preview.yml@dev | ||
| secrets: inherit | ||
|
Comment on lines
+10
to
+11
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show the relevant section with line numbers
sed -n '1,200p' .github/workflows/release-preview.yml | nl -ba | sed -n '1,120p'Repository: TigreGotico/markovonnx Length of output: 109 🌐 Web query:
💡 Result: In GitHub Actions, the Citations:
🏁 Script executed: #!/bin/bash
set -euo pipefail
# Print file with line numbers (avoid `nl`, since it may not exist)
awk 'NR>=1 && NR<=60 {printf "%d: %s\n", NR, $0}' .github/workflows/release-preview.ymlRepository: TigreGotico/markovonnx Length of output: 410 Pin the reusable workflow ref and avoid In Suggested hardening diff- uses: OpenVoiceOS/gh-automations/.github/workflows/release-preview.yml@dev
- secrets: inherit
+ uses: OpenVoiceOS/gh-automations/.github/workflows/release-preview.yml@<pinned_commit_sha>
+ # Omit secrets unless this reusable workflow explicitly requires them.🧰 Tools🪛 zizmor (1.25.2)[error] 10-10: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [warning] 10-10: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow (secrets-inherit) 🤖 Prompt for AI Agents |
||
| with: | ||
| package_name: 'markovonnx' | ||
| version_file: 'markovonnx/version.py' | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: Release Alpha and Propose Stable | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| pull_request: | ||
| types: [closed] | ||
| branches: [dev] | ||
|
|
||
| jobs: | ||
| publish_alpha: | ||
| if: github.event.pull_request.merged == true || github.event_name == 'workflow_dispatch' | ||
| uses: OpenVoiceOS/gh-automations/.github/workflows/publish-alpha.yml@dev | ||
| secrets: inherit | ||
|
Comment on lines
+12
to
+13
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Inspect the specific workflow and surrounding lines
ls -la .github/workflows || true
sed -n '1,220p' .github/workflows/release_workflow.yml | nl -ba | sed -n '1,220p'
# Extract the publish_alpha job section (best-effort)
rg -n "publish_alpha|publish-alpha\.yml|secrets:\s*inherit|uses:\s*OpenVoiceOS/gh-automations" .github/workflows/release_workflow.yml -n || true
# Find other workflows using the same automation repo/workflow to see if they pin commits and how they handle secrets
rg -n "OpenVoiceOS/gh-automations/\.github/workflows/publish-alpha\.yml|OpenVoiceOS/gh-automations/.github/workflows/publish-alpha\.yml@|secrets:\s*inherit" .github/workflows -S || trueRepository: TigreGotico/markovonnx Length of output: 949 🏁 Script executed: #!/bin/bash
set -euo pipefail
# Show the workflow with line numbers (using awk to avoid nl dependency)
awk '{printf "%4d\t%s\n", NR, $0}' .github/workflows/release_workflow.yml | sed -n '1,220p'
# Pull only the relevant bits for publish_alpha
awk 'NR>=1 && NR<=220 {print}' .github/workflows/release_workflow.yml | \
rg -n "publish_alpha|publish-alpha\.yml|secrets:\s*inherit|OpenVoiceOS/gh-automations" || true
# Search other workflows for the same automation and for secrets inheritance
rg -n "OpenVoiceOS/gh-automations/\.github/workflows/publish-alpha\.yml@|OpenVoiceOS/gh-automations/.github/workflows/publish-alpha\.yml@|secrets:\s*inherit" .github/workflows || true
# Also check if publish_stable is similarly pinned
rg -n "publish_stable|publish-stable\.yml|OpenVoiceOS/gh-automations" .github/workflows || trueRepository: TigreGotico/markovonnx Length of output: 2606 Pin the
🧰 Tools🪛 zizmor (1.25.2)[error] 12-12: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy) (unpinned-uses) [warning] 12-12: secrets unconditionally inherited by called workflow (secrets-inherit): this reusable workflow (secrets-inherit) 🤖 Prompt for AI Agents |
||
| with: | ||
| branch: 'dev' | ||
| version_file: 'markovonnx/version.py' | ||
| update_changelog: true | ||
| publish_prerelease: true | ||
| propose_release: true | ||
| changelog_max_issues: 100 | ||
| publish_pypi: true | ||
| notify_matrix: true | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,13 @@ | ||
| name: Repo Health | ||
|
|
||
| on: | ||
| pull_request: | ||
| branches: [dev, master, main] | ||
| workflow_dispatch: | ||
|
|
||
| jobs: | ||
| repo_health: | ||
| uses: OpenVoiceOS/gh-automations/.github/workflows/repo-health.yml@dev | ||
| secrets: inherit | ||
| with: | ||
| version_file: 'markovonnx/version.py' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Add an explicit
permissions:block — the job needspull-requests: writeto apply labels.bcoe/conventional-release-labels@v1calls the Issues/PRs API to add labels usingGITHUB_TOKEN. In repositories (or orgs) where the default workflow token is read-only, the labeling step will fail with a 403. Declaring least-privilege permissions explicitly also tightens the security posture of apull_request_targetworkflow (which runs with access to repo secrets) and silences the dangerous-triggers concern from static analysis since this job only labels and never checks out PR code.🛡️ Proposed fix
# auto add labels to PRs on: pull_request_target: types: [ opened, edited ] name: conventional-release-labels +permissions: + contents: read + pull-requests: write jobs: label: runs-on: ubuntu-latest steps: - uses: bcoe/conventional-release-labels@v1📝 Committable suggestion
🧰 Tools
🪛 zizmor (1.25.2)
[error] 10-10: unpinned action reference (unpinned-uses): action is not pinned to a hash (required by blanket policy)
(unpinned-uses)
🤖 Prompt for AI Agents