From 3e095536e34816723ad726925a35a3f85e42fe02 Mon Sep 17 00:00:00 2001 From: Avelino <31996+avelino@users.noreply.github.com> Date: Mon, 12 Oct 2026 07:19:35 -0300 Subject: [PATCH 1/3] fix(ci): only release from pushes to this repo's main The release gate only checked that CI passed on a branch named main. A pull request from a fork whose branch is also called main passes that check, so its head would be built and published as the latest pre-release. Require the CI run to come from a push in this repo. Also set a read-only default token in both workflows, pin every action by commit SHA, add Dependabot for cargo and actions, and add a security policy. Signed-off-by: Avelino <31996+avelino@users.noreply.github.com> --- .github/dependabot.yml | 16 +++++++++++++ .github/workflows/ci.yml | 45 ++++++++++++++++++----------------- .github/workflows/release.yml | 27 +++++++++++++-------- SECURITY.md | 15 ++++++++++++ 4 files changed, 71 insertions(+), 32 deletions(-) create mode 100644 .github/dependabot.yml create mode 100644 SECURITY.md diff --git a/.github/dependabot.yml b/.github/dependabot.yml new file mode 100644 index 0000000..36451b8 --- /dev/null +++ b/.github/dependabot.yml @@ -0,0 +1,16 @@ +version: 2 +updates: + - package-ecosystem: cargo + directory: / + schedule: + interval: weekly + groups: + cargo-minor-patch: + update-types: [minor, patch] + - package-ecosystem: github-actions + directory: / + schedule: + interval: weekly + groups: + actions: + patterns: ["*"] diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 9ff48e4..8c337cb 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -7,6 +7,9 @@ on: pull_request: branches: [main] +permissions: + contents: read + env: CARGO_TERM_COLOR: always @@ -15,17 +18,17 @@ jobs: name: Check runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 - run: cargo check fmt: name: Format runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable with: components: rustfmt - run: cargo fmt -- --check @@ -34,11 +37,11 @@ jobs: name: Clippy runs-on: ubuntu-latest steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable with: components: clippy - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 - run: cargo clippy -- -D warnings test: @@ -48,9 +51,9 @@ jobs: matrix: os: [ubuntu-latest, macos-latest, windows-latest] steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 - run: cargo test build: @@ -58,9 +61,9 @@ jobs: runs-on: ubuntu-latest needs: [check, fmt, clippy, test] steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 - run: cargo build --release examples: @@ -68,25 +71,23 @@ jobs: runs-on: ubuntu-latest needs: [build] steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@stable - - uses: Swatinem/rust-cache@v2 - + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 + - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 - name: Install Clojure CLI - uses: DeLaGuardo/setup-clojure@12.5 + uses: DeLaGuardo/setup-clojure@c72ba59d25875f7523e06a671431b5f9f084992d # 12.6 with: cli: latest lein: latest - name: Setup Java - uses: actions/setup-java@v4 + uses: actions/setup-java@cf277c60eb25467037889841efdb72551f06f6c3 # v4.9.1 with: distribution: temurin java-version: '21' - name: Setup Gradle - uses: gradle/actions/setup-gradle@v4 - + uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4 - name: Build jbundle run: cargo build --release diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ac117e0..ade7452 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -7,6 +7,9 @@ on: workflows: ["CI"] types: [completed] +permissions: + contents: read + env: CARGO_TERM_COLOR: always @@ -16,7 +19,11 @@ jobs: runs-on: ubuntu-latest if: >- (github.event_name == 'push' && startsWith(github.ref, 'refs/tags/v')) || - (github.event_name == 'workflow_run' && github.event.workflow_run.conclusion == 'success' && github.event.workflow_run.head_branch == 'main') + (github.event_name == 'workflow_run' && + github.event.workflow_run.conclusion == 'success' && + github.event.workflow_run.event == 'push' && + github.event.workflow_run.head_branch == 'main' && + github.event.workflow_run.head_repository.full_name == github.repository) outputs: is_tag: ${{ steps.check.outputs.is_tag }} is_main: ${{ steps.check.outputs.is_main }} @@ -71,15 +78,15 @@ jobs: cross: false steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: ref: ${{ needs.prepare.outputs.sha }} - - uses: dtolnay/rust-toolchain@stable + - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable with: targets: ${{ matrix.target }} - - uses: Swatinem/rust-cache@v2 + - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 with: key: ${{ matrix.target }} @@ -117,14 +124,14 @@ jobs: - name: Upload artifact (unix) if: runner.os != 'Windows' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ matrix.artifact }} path: dist/${{ matrix.artifact }}.tar.gz - name: Upload artifact (windows) if: runner.os == 'Windows' - uses: actions/upload-artifact@v4 + uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4.6.2 with: name: ${{ matrix.artifact }} path: dist/${{ matrix.artifact }}.zip @@ -138,12 +145,12 @@ jobs: contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: ref: ${{ needs.prepare.outputs.sha }} - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: path: artifacts @@ -215,14 +222,14 @@ jobs: contents: write steps: - - uses: actions/checkout@v4 + - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 with: ref: ${{ needs.prepare.outputs.sha }} fetch-depth: 0 fetch-tags: true - name: Download all artifacts - uses: actions/download-artifact@v4 + uses: actions/download-artifact@d3f86a106a0bac45b974a628896c90dbdf5c8093 # v4.3.0 with: path: artifacts diff --git a/SECURITY.md b/SECURITY.md new file mode 100644 index 0000000..7b8b73f --- /dev/null +++ b/SECURITY.md @@ -0,0 +1,15 @@ +# Security Policy + +## Supported versions + +Only the latest tagged release gets security fixes. The `latest` pre-release is a development build from `main` and is not supported. + +## Reporting a vulnerability + +Please don't open a public issue. Report it privately through GitHub: go to the [Security tab](https://github.com/avelino/jbundle/security/advisories/new) and open a draft advisory. + +Include what you found, how to reproduce it and which version you tested. I'll reply as soon as I can and keep you posted until it's fixed. + +## Scope + +jbundle downloads a JDK, runs your build tool (Clojure CLI, Leiningen, Maven or Gradle) and packs the result into a single binary. Issues in that pipeline, in the release workflow or in `install.sh`/`install.ps1` are in scope. Bugs in the JDK or in your own build are not. From 2f4840fd4b3121d34530e9ef8ccefe2e942e587f Mon Sep 17 00:00:00 2001 From: Avelino <31996+avelino@users.noreply.github.com> Date: Mon, 12 Oct 2026 07:26:53 -0300 Subject: [PATCH 2/3] ci: keep the blank lines between steps Signed-off-by: Avelino <31996+avelino@users.noreply.github.com> --- .github/workflows/ci.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 8c337cb..8bfbc22 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -74,6 +74,7 @@ jobs: - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262 # v4.4.0 - uses: dtolnay/rust-toolchain@686976e191b89faba57d3206551f0f330d8cb249 # stable - uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 + - name: Install Clojure CLI uses: DeLaGuardo/setup-clojure@c72ba59d25875f7523e06a671431b5f9f084992d # 12.6 with: @@ -88,6 +89,7 @@ jobs: - name: Setup Gradle uses: gradle/actions/setup-gradle@748248ddd2a24f49513d8f472f81c3a07d4d50e1 # v4.4.4 + - name: Build jbundle run: cargo build --release From 620b227bf14f1e1ca0acdd695e1836b7df27cc27 Mon Sep 17 00:00:00 2001 From: Avelino <31996+avelino@users.noreply.github.com> Date: Mon, 12 Oct 2026 13:51:20 -0300 Subject: [PATCH 3/3] docs(security): add a private fallback when advisories are unavailable Signed-off-by: Avelino <31996+avelino@users.noreply.github.com> --- SECURITY.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/SECURITY.md b/SECURITY.md index 7b8b73f..8ebdb2c 100644 --- a/SECURITY.md +++ b/SECURITY.md @@ -8,6 +8,8 @@ Only the latest tagged release gets security fixes. The `latest` pre-release is Please don't open a public issue. Report it privately through GitHub: go to the [Security tab](https://github.com/avelino/jbundle/security/advisories/new) and open a draft advisory. +If that link doesn't work for you, open an issue titled `Security contact request` with no details about the problem, and I'll reach out to you privately. + Include what you found, how to reproduce it and which version you tested. I'll reply as soon as I can and keep you posted until it's fixed. ## Scope