Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,19 +19,19 @@ jobs:
permissions:
contents: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
fetch-depth: 0
Comment on lines +22 to 24

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major | ⚡ Quick win

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Verify checkout hardening across workflows (read-only)
rg -n --iglob '.github/workflows/*.yml' 'uses:\s*actions/checkout@' -A6 -B1

Repository: UltiKits/UltiBot

Length of output: 209


Harden actions/checkout by disabling credential persistence in publish.yml.

The checkout step only sets fetch-depth: 0; add persist-credentials: false to prevent the GitHub token from being persisted in local git config for later steps.

Suggested patch
       - uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
         with:
           fetch-depth: 0
+          persist-credentials: false
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
fetch-depth: 0
- uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
with:
fetch-depth: 0
persist-credentials: false
🧰 Tools
🪛 zizmor (1.25.2)

[warning] 22-24: credential persistence through GitHub Actions artifacts (artipacked): does not set persist-credentials: false

(artipacked)

🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

In @.github/workflows/publish.yml around lines 22 - 24, The checkout step in
publish.yml uses actions/checkout (the job step with "uses:
actions/checkout@93cb6efe18208431c...") but only sets fetch-depth: 0; add the
option persist-credentials: false to that checkout step to prevent the
GITHUB_TOKEN from being written to local git config and persisted for later
steps (modify the actions/checkout step to include persist-credentials: false
alongside fetch-depth: 0).


- name: Set up JDK
uses: actions/setup-java@v4
uses: actions/setup-java@be666c2fcd27ec809703dec50e508c2fdc7f6654 # v5.2.0
with:
java-version: '21'
distribution: 'temurin'
cache: maven

- name: Run SpigotMC BuildTools
uses: SpraxDev/Action-SpigotMC@v5
uses: SpraxDev/Action-SpigotMC@6419bc4cdfb60d37bd3f541f6c8d5be60e6e0933 # v5.3.0
with:
versions: '1.21.1'
remapped: true
Expand Down Expand Up @@ -97,7 +97,7 @@ jobs:

- name: Set up Node.js
if: steps.check.outputs.EXISTS == 'false'
uses: actions/setup-node@v4
uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444 # v5.0.0
with:
node-version: '20'

Expand Down