Repository navigation
chore!: publish as moq-noq, moq-noq-proto, and moq-noq-udp #1
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,53 @@ | ||
| # The fork's own CI. Upstream's workflows stay in the tree so a sync never | ||
| # conflicts on them, but they are disabled in the repository settings because | ||
| # they need n0's self-hosted runners and secrets. | ||
| name: moq-ci | ||
|
|
||
| on: | ||
| pull_request: | ||
| push: | ||
| branches: | ||
| - main | ||
|
|
||
| concurrency: | ||
| group: moq-ci-${{ github.event.pull_request.number || github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| RUST_BACKTRACE: 1 | ||
| RUSTFLAGS: -Dwarnings | ||
| RUSTDOCFLAGS: -Dwarnings | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| check: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 45 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| with: | ||
| components: clippy, rustfmt | ||
| - uses: Swatinem/rust-cache@v2 | ||
| # The same rustfmt options as upstream's `cargo make format-check`. | ||
| - run: cargo fmt --all --check -- --config unstable_features=true --config imports_granularity=Crate,group_imports=Preserve,reorder_imports=false,format_code_in_doc_comments=true,comment_width=100,wrap_comments=true | ||
| - run: cargo clippy --workspace --all-targets --locked | ||
| - run: cargo doc --workspace --no-deps --locked | ||
| - run: cargo test --workspace --locked | ||
| # Every commit must stay publishable, so the release job cannot fail on metadata. | ||
| - run: cargo publish --workspace --locked --dry-run | ||
|
|
||
| parent: | ||
| name: PARENT names an upstream commit | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
| - run: | | ||
| parent=$(cat PARENT) | ||
| git fetch --depth=1 https://github.com/n0-computer/noq.git "$parent" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,37 @@ | ||
| # Publishes moq-noq-proto, moq-noq-udp, and moq-noq when a `v*` tag is pushed. | ||
| # The tag must match `workspace.package.version`. | ||
| # | ||
| # Uses crates.io trusted publishing, so each crate must list this repository | ||
| # and workflow as a trusted publisher. The very first version of a crate has to | ||
| # be published with a token from a maintainer's machine. | ||
| name: moq-release | ||
|
|
||
| on: | ||
| push: | ||
| tags: | ||
| - "v*" | ||
|
|
||
| permissions: | ||
| contents: read | ||
|
|
||
| jobs: | ||
| publish: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 30 | ||
| environment: release | ||
| permissions: | ||
| id-token: write | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
| with: | ||
| persist-credentials: false | ||
| - uses: dtolnay/rust-toolchain@stable | ||
| - name: Tag matches the workspace version | ||
| run: | | ||
| version=$(cargo metadata --format-version=1 --no-deps | jq -r '.packages[] | select(.name == "moq-noq") | .version') | ||
| test "v$version" = "${GITHUB_REF_NAME}" || { echo "tag ${GITHUB_REF_NAME} but Cargo.toml says $version"; exit 1; } | ||
| - uses: rust-lang/crates-io-auth-action@v1 | ||
| id: auth | ||
| - run: cargo publish --workspace --locked | ||
| env: | ||
| CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,49 @@ | ||
| # Merges n0-computer/noq main into the fork weekly and opens a pull request | ||
| # with the result, so drift is visible before it is expensive. A merge that | ||
| # conflicts fails the job; resolve it by hand with the same commands. | ||
| name: moq-sync | ||
|
|
||
| on: | ||
| schedule: | ||
| - cron: "0 6 * * 1" | ||
| workflow_dispatch: | ||
|
|
||
| permissions: | ||
| contents: write | ||
| pull-requests: write | ||
|
|
||
| jobs: | ||
| sync: | ||
| runs-on: ubuntu-latest | ||
| timeout-minutes: 15 | ||
| steps: | ||
| - uses: actions/checkout@v6 | ||
|
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. 🔒 Security & Privacy | 🛡️ Detected with Advanced Tier | 🟠 Major | ⚡ Quick win Security Misconfiguration Reachability: External Pin write-capable Actions to verified commit SHAs. These action references use mutable tags while this job grants Also applies to: 41-41 🤖 Prompt for AI Agents |
||
| with: | ||
| fetch-depth: 0 | ||
| - name: Merge upstream main | ||
| id: merge | ||
| run: | | ||
| git config user.name "github-actions[bot]" | ||
| git config user.email "github-actions[bot]@users.noreply.github.com" | ||
| git remote add upstream https://github.com/n0-computer/noq.git | ||
| git fetch upstream main | ||
| parent=$(git rev-parse upstream/main) | ||
| if test "$(cat PARENT)" = "$parent"; then | ||
| echo "up to date with $parent" | ||
| echo "changed=false" >> "$GITHUB_OUTPUT" | ||
| exit 0 | ||
| fi | ||
| git merge --no-edit upstream/main | ||
| echo "$parent" > PARENT | ||
| git commit -am "chore: record parent $parent" | ||
| echo "changed=true" >> "$GITHUB_OUTPUT" | ||
| echo "parent=$parent" >> "$GITHUB_OUTPUT" | ||
| - uses: peter-evans/create-pull-request@v7 | ||
|
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. 🎯 Functional Correctness | 🟠 Major | 🏗️ Heavy lift 🔎 Supported by static analysis🏁 Script executed: sed -n '1,120p' .github/workflows/moq-sync.yml
sed -n '1,100p' .github/workflows/moq-ci.yml
rg -n 'actions|fork|pull_request|workflow' .github README.mdRepository: moq-dev/noq Length of output: 18333 🌐 Web query:
💡 Result: <source_evidence> Citations:
Make sync pull-request CI run automatically.
🤖 Prompt for AI Agents |
||
| if: steps.merge.outputs.changed == 'true' | ||
| with: | ||
| branch: sync/upstream | ||
| title: "chore: sync with n0-computer/noq" | ||
| body: | | ||
| Merges n0-computer/noq main at ${{ steps.merge.outputs.parent }}. | ||
|
|
||
| Compare the carried set with `git log --no-merges upstream/main..main`. | ||
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1 @@ | ||
| 1a26a8b064d21e316fe6769f068617975bd8a27b |
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.
🔒 Security & Privacy | 🟠 Major | ⚡ Quick win
🔎 Supported by static analysis
🏁 Script executed:
Repository: moq-dev/noq
Length of output: 1617
Pin all release actions to verified commit SHAs. The job uses mutable refs:
actions/checkout@v6,dtolnay/rust-toolchain@stable, andrust-lang/crates-io-auth-action@v1. The job grantsid-token: write, passes the authentication action's token toCARGO_REGISTRY_TOKEN, and publishes the workspace. A retargeted action can run with this permission and publish a malicious crates.io release. Pin all three actions to verified full commit SHAs, while retaining version comments for readability.🤖 Prompt for AI Agents