Compare commits

..
Author SHA1 Message Date
Robby RussellandClaude Opus 5.5 8ee263a828 fix(alias-finder): suggest aliases when the command starts with an alias
The automatic hook searched the command exactly as typed, so `k get pods`
never matched `kgp='kubectl get pods'`. It now searches the alias-expanded
command zsh passes to preexec ($3). When the command started with an alias,
only aliases that cover more of the command are suggested, so typing `gst`
alone still prints nothing.

Closes #12040

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-27 19:29:14 -08:00
27 changed files with 94 additions and 5992 deletions

No files matched your search

-20
View File
@@ -6,8 +6,6 @@ updates:
interval: "weekly" interval: "weekly"
day: "sunday" day: "sunday"
labels: [] labels: []
cooldown:
default-days: 7
groups: groups:
gha-minor: gha-minor:
patterns: patterns:
@@ -21,8 +19,6 @@ updates:
interval: "weekly" interval: "weekly"
day: "sunday" day: "sunday"
labels: [] labels: []
cooldown:
default-days: 7
groups: groups:
py-minor: py-minor:
patterns: patterns:
@@ -30,19 +26,3 @@ updates:
update-types: update-types:
- minor - minor
- patch - patch
- package-ecosystem: npm
directory: "/.github/workflows/installer"
schedule:
interval: "weekly"
day: "sunday"
labels: []
cooldown:
default-days: 7
groups:
npm-minor:
patterns:
- "*"
update-types:
- major
- minor
- patch
-66
View File
@@ -1,66 +0,0 @@
# Workflow checks
The `Workflow lint` workflow runs jactionlint on pull requests and pushes to
`master`. It checks workflows and Dependabot configuration with the default
profile, including ShellCheck for inline shell scripts. It runs without online
checks or publishing credentials.
To run the same checks locally, install jactionlint 2.6.0 and ShellCheck, then run
from the repository root:
```sh
jactionlint --profile=default --no-online
```
Keep the local jactionlint version aligned with the pinned action in `lint.yml`.
There is no baseline: new findings fail the check. Any rule exception should be
limited to the relevant line and explain why it is needed.
## Action lockfile
`actions.lock` records the commit for every action the workflows use, including
actions called by other actions. Workflows reference release tags; the lockfile
holds the commit that runs. Do not edit it by hand.
After adding a workflow or changing any `uses:` line, regenerate it with the
[`gh actions-lock`](https://github.com/github/gh-actions-lock) extension and
commit the result:
```sh
gh extension install github/gh-actions-lock
gh actions-lock
```
Dependabot updates the lockfile entry in the same pull request when it bumps an
action.
The `Workflow lint` workflow verifies the lockfile on every pull request and
fails when it does not match the workflows.
## Project tracking
`project.yml` intentionally uses `pull_request_target` so the GitHub App can add
fork contributions to the project board. It must not check out or execute PR
code. Project IDs are validated before passing them through step outputs, and
PR-derived plugin/theme names are restricted to letters, digits, dots, underscores
and hyphens.
The App tokens request explicit permissions: project tracking needs organization
projects write access and issues/pull requests read access; dependency updates
need contents read access and issues/pull requests write access. Dependency pushes
use the job's separate `GITHUB_TOKEN` with contents write access.
## Installer deployment
The Vercel CLI is pinned in `installer/package.json` and `installer/package-lock.json`.
Dependabot checks this dependency weekly, with a seven-day cooldown for version
updates, like the other configured ecosystems. Deployment installs the lockfile
with `npm ci --ignore-scripts`; `.vercelignore` uploads only `install.sh`.
After changing the CLI version, update its lockfile and verify the CLI locally:
```sh
npm install --package-lock-only --ignore-scripts --prefix .github/workflows/installer
npm ci --ignore-scripts --prefix .github/workflows/installer
.github/workflows/installer/node_modules/.bin/vercel --version
```
-90
View File
@@ -1,90 +0,0 @@
# This file is machine-generated by `gh actions-lock`.
# Do not edit by hand; run `gh actions-lock` to update.
# Docs: https://gh.io/actions-lockfile
version: 'v0.0.3'
workflows:
'.github/workflows/dependencies.yml':
- 'actions/checkout@v7.0.1'
- 'actions/create-github-app-token@v3.4.0'
- 'actions/setup-python@v7.1.0'
- 'step-security/harden-runner@v2.23.0'
'.github/workflows/installer.yml':
- 'actions/checkout@v7.0.1'
- 'actions/setup-node@v7.1.0'
- 'step-security/harden-runner@v2.23.0'
'.github/workflows/lint.yml':
- 'actions/checkout@v7.0.1'
- 'github/gh-actions-lock@verify/v0.5.1'
- 'jdx/jactionlint@v2.6.0'
- 'step-security/harden-runner@v2.23.0'
'.github/workflows/main.yml':
- 'actions/checkout@v7.0.1'
- 'actions/setup-python@v7.1.0'
- 'step-security/harden-runner@v2.23.0'
'.github/workflows/project.yml':
- 'actions/create-github-app-token@v3.4.0'
- 'step-security/harden-runner@v2.23.0'
'.github/workflows/scorecard.yml':
- 'actions/checkout@v7.0.1'
- 'actions/upload-artifact@v7.0.2'
- 'github/codeql-action@v4.39.5'
- 'ossf/scorecard-action@v2.6.0'
- 'step-security/harden-runner@v2.23.0'
dependencies:
'actions/checkout@v7.0.1':
ref: 'v7.0.1'
commit: 'sha1-3d3c42e5aac5ba805825da76410c181273ba90b1'
owner_id: 44036562
repo_id: 197814629
'actions/create-github-app-token@v3.4.0':
ref: 'v3.4.0'
commit: 'sha1-f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc'
owner_id: 44036562
repo_id: 642580244
'actions/setup-node@v7.1.0':
ref: 'v7.1.0'
commit: 'sha1-949feb2413d6458794dcd2491c4babbbce0c15c1'
owner_id: 44036562
repo_id: 189476904
'actions/setup-python@v7.1.0':
ref: 'v7.1.0'
commit: 'sha1-6d4fd22b20465ccc0f7354476588e8df7c9ca0e0'
owner_id: 44036562
repo_id: 192625525
'actions/upload-artifact@v7.0.2':
ref: 'v7.0.2'
commit: 'sha1-cf430e030ddbb5b0abf93d22962f4752f3646cd9'
owner_id: 44036562
repo_id: 192625955
'github/codeql-action@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2':
ref: 'v4.38.2'
commit: 'sha1-2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2'
owner_id: 9919
repo_id: 259445878
'github/codeql-action@v4.39.5':
ref: 'v4.39.5'
commit: 'sha1-915412ff23e8b7659517e607487dbeae018f2934'
owner_id: 9919
repo_id: 259445878
'github/gh-actions-lock@verify/v0.5.1':
ref: 'verify/v0.5.1'
commit: 'sha1-5fa07d19c267d19e29f4341f10fdf7f516375038'
owner_id: 9919
repo_id: 1217640442
'jdx/jactionlint@v2.6.0':
ref: 'v2.6.0'
commit: 'sha1-72c00452809bcca05b8bc12acdcf15dd7a9c1c5e'
owner_id: 216188
repo_id: 1404951382
uses:
- 'github/codeql-action@2892aa5e19bbd11bc0cff5427e3b750a04d9e3c2'
'ossf/scorecard-action@v2.6.0':
ref: 'v2.6.0'
commit: 'sha1-23f22cd43608bae7a1f1fa2603d7314dee9538a5'
owner_id: 67707773
repo_id: 421101922
'step-security/harden-runner@v2.23.0':
ref: 'v2.23.0'
commit: 'sha1-aebdcf6156ab6691adf63218240e476564a1ed4c'
owner_id: 88700172
repo_id: 422287306
+4 -8
View File
@@ -11,31 +11,27 @@ jobs:
check: check:
name: Check for updates name: Check for updates
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 30
if: github.repository == 'ohmyzsh/ohmyzsh' if: github.repository == 'ohmyzsh/ohmyzsh'
permissions: permissions:
contents: write # this is needed to push commits and branches contents: write # this is needed to push commits and branches
steps: steps:
- name: Harden the runner (Audit all outbound calls) - name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@v2.23.0 uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with: with:
egress-policy: audit egress-policy: audit
- name: Checkout - name: Checkout
uses: actions/checkout@v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: with:
fetch-depth: 0 fetch-depth: 0
- name: Authenticate as @ohmyzsh - name: Authenticate as @ohmyzsh
id: generate-token id: generate-token
uses: actions/create-github-app-token@v3.4.0 uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
with: with:
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }} client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }} private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
permission-contents: read
permission-issues: write
permission-pull-requests: write
- name: Setup Python - name: Setup Python
uses: actions/setup-python@v7.1.0 uses: actions/setup-python@6d4fd22b20465ccc0f7354476588e8df7c9ca0e0 # v7.1.0
with: with:
python-version: "3.12" python-version: "3.12"
cache: "pip" cache: "pip"
@@ -1,7 +1,7 @@
certifi==2026.11.20 certifi==2026.10.23
charset-normalizer==3.5.3 charset-normalizer==3.5.2
idna==3.20 idna==3.20
PyYAML==6.0.4 PyYAML==6.0.3
requests==2.34.2 requests==2.34.2
semver==3.1.3 semver==3.1.2
urllib3==2.8.0 urllib3==2.8.0
+6 -16
View File
@@ -19,7 +19,6 @@ jobs:
name: Test installer name: Test installer
if: github.repository == 'ohmyzsh/ohmyzsh' if: github.repository == 'ohmyzsh/ohmyzsh'
runs-on: ${{ matrix.os }} runs-on: ${{ matrix.os }}
timeout-minutes: 15
strategy: strategy:
matrix: matrix:
os: os:
@@ -27,12 +26,12 @@ jobs:
- macos-latest - macos-latest
steps: steps:
- name: Harden the runner (Audit all outbound calls) - name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@v2.23.0 uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with: with:
egress-policy: audit egress-policy: audit
- name: Set up git repository - name: Set up git repository
uses: actions/checkout@v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install zsh - name: Install zsh
if: runner.os == 'Linux' if: runner.os == 'Linux'
run: sudo apt-get update; sudo apt-get install zsh run: sudo apt-get update; sudo apt-get install zsh
@@ -43,28 +42,19 @@ jobs:
name: Deploy installer in install.ohmyz.sh name: Deploy installer in install.ohmyz.sh
if: github.ref == 'refs/heads/master' if: github.ref == 'refs/heads/master'
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15
environment: vercel environment: vercel
needs: needs:
- test - test
steps: steps:
- name: Harden the runner (Audit all outbound calls) - name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@v2.23.0 uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with: with:
egress-policy: audit egress-policy: audit
- name: Checkout - name: Checkout
uses: actions/checkout@v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@v7.1.0
with:
node-version: "24"
package-manager-cache: false
- name: Install Vercel CLI - name: Install Vercel CLI
working-directory: .github/workflows/installer run: npm install -g vercel
run: npm ci --ignore-scripts --no-audit --no-fund
- name: Setup project and deploy - name: Setup project and deploy
env: env:
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }} VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
@@ -73,4 +63,4 @@ jobs:
run: | run: |
cp tools/install.sh .github/workflows/installer/install.sh cp tools/install.sh .github/workflows/installer/install.sh
cd .github/workflows/installer cd .github/workflows/installer
./node_modules/.bin/vercel deploy --prod -t "$VERCEL_TOKEN" vc deploy --prod -t "$VERCEL_TOKEN"
-1
View File
@@ -1,2 +1 @@
install.sh install.sh
node_modules/
File diff suppressed because it is too large. Load diff
-7
View File
@@ -1,7 +0,0 @@
{
"name": "ohmyzsh-installer-deploy",
"private": true,
"devDependencies": {
"vercel": "66.6.0"
}
}
-35
View File
@@ -1,35 +0,0 @@
name: Workflow lint
on:
pull_request:
push:
branches:
- master
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
permissions:
contents: read
jobs:
jactionlint:
name: Lint GitHub Actions
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@v2.23.0
with:
egress-policy: audit
- name: Checkout
uses: actions/checkout@v7.0.1
with:
persist-credentials: false
- name: Lint workflows and Dependabot configuration
uses: jdx/jactionlint@v2.6.0
with:
profile: default
online: "false"
- name: Verify action lockfile
uses: github/gh-actions-lock@verify/v0.5.1
+5 -7
View File
@@ -21,16 +21,15 @@ jobs:
tests: tests:
name: Run tests name: Run tests
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10
if: github.repository == 'ohmyzsh/ohmyzsh' if: github.repository == 'ohmyzsh/ohmyzsh'
steps: steps:
- name: Harden the runner (Audit all outbound calls) - name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@v2.23.0 uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with: with:
egress-policy: audit egress-policy: audit
- name: Set up git repository - name: Set up git repository
uses: actions/checkout@v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Install zsh - name: Install zsh
run: sudo apt-get update; sudo apt-get install zsh run: sudo apt-get update; sudo apt-get install zsh
- name: Check syntax - name: Check syntax
@@ -46,12 +45,11 @@ jobs:
collisions: collisions:
name: Check alias collisions name: Check alias collisions
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10
steps: steps:
- name: Set up git repository - name: Set up git repository
uses: actions/checkout@v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- name: Set up Python - name: Set up Python
uses: actions/setup-python@v7.1.0 uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97 # v7.0.0
with: with:
python-version: '3.14' python-version: '3.14'
- name: Install dependencies - name: Install dependencies
@@ -63,7 +61,7 @@ jobs:
cd .github/workflows/alias_collision/ cd .github/workflows/alias_collision/
python -m pytest python -m pytest
- name: Checkout target branch - name: Checkout target branch
uses: actions/checkout@v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: with:
path: ohmyzsh-target-branch path: ohmyzsh-target-branch
ref: master ref: master
+11 -43
View File
@@ -2,8 +2,6 @@ name: Project tracking
on: on:
issues: issues:
types: [opened, reopened] types: [opened, reopened]
# Board updates need an App token for fork PRs; no PR code is checked out or run.
# jactionlint ignore=dangerous-triggers
pull_request_target: pull_request_target:
types: [opened, reopened, synchronize] types: [opened, reopened, synchronize]
@@ -16,35 +14,25 @@ jobs:
add-to-project: add-to-project:
name: Add to project name: Add to project
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 10
defaults:
run:
shell: bash
if: github.repository == 'ohmyzsh/ohmyzsh' if: github.repository == 'ohmyzsh/ohmyzsh'
steps: steps:
- name: Harden the runner (Audit all outbound calls) - name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@v2.23.0 uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with: with:
egress-policy: audit egress-policy: audit
- name: Authenticate as @ohmyzsh - name: Authenticate as @ohmyzsh
id: generate-token id: generate-token
uses: actions/create-github-app-token@v3.4.0 uses: actions/create-github-app-token@f418cff399f7aef4c2f0ad47e25ca7a6abbdd6fc # v3.4.0
with: with:
client-id: ${{ secrets.OHMYZSH_CLIENT_ID }} client-id: ${{ secrets.OHMYZSH_CLIENT_ID }}
private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }} private-key: ${{ secrets.OHMYZSH_APP_PRIVATE_KEY }}
permission-organization-projects: write
permission-issues: read
permission-pull-requests: read
- name: Read project data - name: Read project data
id: project
env: env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }} GH_TOKEN: ${{ steps.generate-token.outputs.token }}
ORGANIZATION: ohmyzsh ORGANIZATION: ohmyzsh
PROJECT_NUMBER: "1" PROJECT_NUMBER: "1"
run: | run: |
# Get Project data # Get Project data
# GraphQL variables must reach GitHub literally.
# shellcheck disable=SC2016
gh api graphql -f query=' gh api graphql -f query='
query($org: String!, $number: Int!) { query($org: String!, $number: Int!) {
organization(login: $org){ organization(login: $org){
@@ -60,29 +48,19 @@ jobs:
} }
} }
} }
}' -f org="$ORGANIZATION" -F number="$PROJECT_NUMBER" > project_data.json }' -f org=$ORGANIZATION -F number=$PROJECT_NUMBER > project_data.json
# Parse project data # Parse project data
PROJECT_ID=$(jq -er '.data.organization.projectV2.id' project_data.json) cat >> "$GITHUB_ENV" <<EOF
PLUGIN_FIELD_ID=$(jq -er '.data.organization.projectV2.fields.nodes[] | select(.name == "Plugin") | .id' project_data.json) PROJECT_ID=$(jq '.data.organization.projectV2.id' project_data.json)
THEME_FIELD_ID=$(jq -er '.data.organization.projectV2.fields.nodes[] | select(.name == "Theme") | .id' project_data.json) PLUGIN_FIELD_ID=$(jq '.data.organization.projectV2.fields.nodes[] | select(.name == "Plugin") | .id' project_data.json)
for id in "$PROJECT_ID" "$PLUGIN_FIELD_ID" "$THEME_FIELD_ID"; do THEME_FIELD_ID=$(jq '.data.organization.projectV2.fields.nodes[] | select(.name == "Theme") | .id' project_data.json)
[[ "$id" =~ ^[A-Za-z0-9_=/+-]+$ ]] || exit 1 EOF
done
{
echo "PROJECT_ID=$PROJECT_ID"
echo "PLUGIN_FIELD_ID=$PLUGIN_FIELD_ID"
echo "THEME_FIELD_ID=$THEME_FIELD_ID"
} >> "$GITHUB_OUTPUT"
- name: Add to project - name: Add to project
id: item
env: env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }} GH_TOKEN: ${{ steps.generate-token.outputs.token }}
ISSUE_OR_PR_ID: ${{ github.event.issue.node_id || github.event.pull_request.node_id }} ISSUE_OR_PR_ID: ${{ github.event.issue.node_id || github.event.pull_request.node_id }}
PROJECT_ID: ${{ steps.project.outputs.PROJECT_ID }}
run: | run: |
# GraphQL variables must reach GitHub literally.
# shellcheck disable=SC2016
item_id="$(gh api graphql -f query=' item_id="$(gh api graphql -f query='
mutation($project: ID!, $content: ID!) { mutation($project: ID!, $content: ID!) {
addProjectV2ItemById(input: {projectId: $project, contentId: $content}) { addProjectV2ItemById(input: {projectId: $project, contentId: $content}) {
@@ -91,12 +69,10 @@ jobs:
} }
} }
} }
' -f project="$PROJECT_ID" -f content="$ISSUE_OR_PR_ID" --jq '.data.addProjectV2ItemById.item.id // error("missing project item ID")')" ' -f project="$PROJECT_ID" -f content="$ISSUE_OR_PR_ID" --jq '.data.addProjectV2ItemById.item.id')"
[[ "$item_id" =~ ^[A-Za-z0-9_=/+-]+$ ]] || exit 1 echo "ITEM_ID=$item_id" >> $GITHUB_ENV
echo "ITEM_ID=$item_id" >> "$GITHUB_OUTPUT"
- name: Classify Pull Request - name: Classify Pull Request
id: classify
if: github.event_name == 'pull_request_target' if: github.event_name == 'pull_request_target'
env: env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }} GH_TOKEN: ${{ steps.generate-token.outputs.token }}
@@ -133,20 +109,12 @@ jobs:
print "THEME=" theme print "THEME=" theme
} }
} }
' >> "$GITHUB_OUTPUT" ' >> "$GITHUB_ENV"
- name: Fill Pull Request fields in project - name: Fill Pull Request fields in project
if: github.event_name == 'pull_request_target' if: github.event_name == 'pull_request_target'
env: env:
GH_TOKEN: ${{ steps.generate-token.outputs.token }} GH_TOKEN: ${{ steps.generate-token.outputs.token }}
PROJECT_ID: ${{ steps.project.outputs.PROJECT_ID }}
ITEM_ID: ${{ steps.item.outputs.ITEM_ID }}
PLUGIN_FIELD_ID: ${{ steps.project.outputs.PLUGIN_FIELD_ID }}
PLUGIN: ${{ steps.classify.outputs.PLUGIN }}
THEME_FIELD_ID: ${{ steps.project.outputs.THEME_FIELD_ID }}
THEME: ${{ steps.classify.outputs.THEME }}
run: | run: |
# GraphQL variables must reach GitHub literally.
# shellcheck disable=SC2016
gh api graphql -f query=' gh api graphql -f query='
mutation ( mutation (
$project: ID! $project: ID!
+7 -12
View File
@@ -14,18 +14,13 @@ on:
push: push:
branches: ["master"] branches: ["master"]
concurrency: # Declare default permissions as read only.
group: ${{ github.workflow }}-${{ github.ref }} permissions: read-all
cancel-in-progress: true
# Permissions are granted only to the analysis job.
permissions: {}
jobs: jobs:
analysis: analysis:
name: Scorecard analysis name: Scorecard analysis
runs-on: ubuntu-latest runs-on: ubuntu-latest
timeout-minutes: 15
permissions: permissions:
# Needed to upload the results to code-scanning dashboard. # Needed to upload the results to code-scanning dashboard.
security-events: write security-events: write
@@ -41,30 +36,30 @@ jobs:
steps: steps:
- name: Harden the runner (Audit all outbound calls) - name: Harden the runner (Audit all outbound calls)
uses: step-security/harden-runner@v2.23.0 uses: step-security/harden-runner@aebdcf6156ab6691adf63218240e476564a1ed4c # v2.23.0
with: with:
egress-policy: audit egress-policy: audit
- name: "Checkout code" - name: "Checkout code"
uses: actions/checkout@v7.0.1 uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with: with:
persist-credentials: false persist-credentials: false
- name: "Run analysis" - name: "Run analysis"
uses: ossf/scorecard-action@v2.6.0 uses: ossf/scorecard-action@23f22cd43608bae7a1f1fa2603d7314dee9538a5 # v2.6.0
with: with:
results_file: results.sarif results_file: results.sarif
results_format: sarif results_format: sarif
publish_results: true publish_results: true
- name: "Upload artifact" - name: "Upload artifact"
uses: actions/upload-artifact@v7.0.2 uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with: with:
name: SARIF file name: SARIF file
path: results.sarif path: results.sarif
retention-days: 5 retention-days: 5
- name: "Upload to code-scanning" - name: "Upload to code-scanning"
uses: github/codeql-action/upload-sarif@v4.39.5 uses: github/codeql-action/upload-sarif@33d7b85da1a04171e211befe2c739303b9a4c066 # v4.39.3
with: with:
sarif_file: results.sarif sarif_file: results.sarif
+3 -4
View File
@@ -237,10 +237,9 @@ function _omz_diag_dump_one_big_text() {
fi fi
builtin echo builtin echo
builtin echo "Zsh compdump files:" builtin echo "Zsh compdump files:"
local dumpfile local dumpfile dumpfiles
local -U dumpfiles command ls -lad $zdotdir/.zcompdump*
dumpfiles=( $zdotdir/.zcompdump*(N) ${ZSH_COMPDUMP:h}/.zcompdump*(N) ) dumpfiles=( $zdotdir/.zcompdump*(N) )
(( $#dumpfiles )) && command ls -lad $dumpfiles
if [[ $verbose -ge 2 ]]; then if [[ $verbose -ge 2 ]]; then
for dumpfile in $dumpfiles; do for dumpfile in $dumpfiles; do
_omz_diag_dump_echo_file_w_header $dumpfile _omz_diag_dump_echo_file_w_header $dumpfile
+1 -1
View File
@@ -231,7 +231,7 @@ function omz_urlencode() {
url_str+="$byte" url_str+="$byte"
else else
ord=$(( [##16] #byte )) ord=$(( [##16] #byte ))
url_str+="%${(l:2::0:)ord}" url_str+="%$ord"
fi fi
fi fi
done done
+1 -1
View File
@@ -128,7 +128,7 @@ fi
# Save the location of the current completion dump file. # Save the location of the current completion dump file.
if [[ -z "$ZSH_COMPDUMP" ]]; then if [[ -z "$ZSH_COMPDUMP" ]]; then
ZSH_COMPDUMP="${ZSH_CACHE_DIR}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}" ZSH_COMPDUMP="${ZDOTDIR:-$HOME}/.zcompdump-${SHORT_HOST}-${ZSH_VERSION}"
fi fi
# Resolve the commit $ZSH is checked out at into $REPLY by reading the git # Resolve the commit $ZSH is checked out at into $REPLY by reading the git
+2
View File
@@ -58,6 +58,8 @@ Running the shortest `gs` shell alias that it found:
![image](https://github.com/ohmyzsh/ohmyzsh/assets/19378/39642750-fb10-4f1a-b7f9-f36789eeb01b) ![image](https://github.com/ohmyzsh/ohmyzsh/assets/19378/39642750-fb10-4f1a-b7f9-f36789eeb01b)
It also looks through aliases you type, suggesting only ones that cover more of the command. With the kubectl plugin, `k get pods` suggests `kgp`, while `kgp` on its own suggests nothing.
### Options ### Options
+13 -2
View File
@@ -65,9 +65,20 @@ alias-finder() {
preexec_alias-finder() { preexec_alias-finder() {
# TODO: Remove backward compatibility (other than zstyle form) # TODO: Remove backward compatibility (other than zstyle form)
zstyle -t ':omz:plugins:alias-finder' autoload && alias-finder $1 || if [[ $ZSH_ALIAS_FINDER_AUTOMATIC = true ]]; then zstyle -t ':omz:plugins:alias-finder' autoload || [[ $ZSH_ALIAS_FINDER_AUTOMATIC = true ]] || return
alias-finder $1
# $3 has aliases expanded, so `k get pods` can suggest `kgp`
local -a words=(${(z)1}) found=(${(f)"$(alias-finder $3)"}) keep
local used=${aliases[$words[1]]} line
# If an alias was typed, only suggest aliases that cover more of the command
if [[ -n "$used" ]]; then
for line in $found; do
(( ${#${(Q)line#*=}} > ${#used} )) && keep+=("$line")
done
found=($keep)
fi fi
(( $#found )) && print -rl -- $found
} }
autoload -U add-zsh-hook autoload -U add-zsh-hook
+4 -4
View File
@@ -103,8 +103,8 @@ upgrades were available. Use `pacman -Que` instead.
| parep | `pacaur -Si` | Display information about a package in the repositories | | parep | `pacaur -Si` | Display information about a package in the repositories |
| pareps | `pacaur -Ss` | Search for packages in the repositories | | pareps | `pacaur -Ss` | Search for packages in the repositories |
| paupd | `pacaur -Sy` | Update and refresh local package, ABS and AUR databases | | paupd | `pacaur -Sy` | Update and refresh local package, ABS and AUR databases |
| paupg | `pacaur -Syu` | Sync with repositories before upgrading all packages (from AUR too) | | paupg | `pacaur -Syua` | Sync with repositories before upgrading all packages (from AUR too) |
| pasu | `pacaur -Syu --noconfirm` | Same as `paupg`, but without confirmation | | pasu | `pacaur -Syua --no-confirm` | Same as `paupg`, but without confirmation |
| upgrade[¹](#f1) | `pacaur -Syu` | Sync with repositories before upgrading packages | | upgrade[¹](#f1) | `pacaur -Syu` | Sync with repositories before upgrading packages |
#### Trizen #### Trizen
@@ -128,7 +128,7 @@ upgrades were available. Use `pacman -Que` instead.
| trreps | `trizen -Ss` | Search for packages in the repositories | | trreps | `trizen -Ss` | Search for packages in the repositories |
| trupd | `trizen -Sy` | Update and refresh local package, ABS and AUR databases | | trupd | `trizen -Sy` | Update and refresh local package, ABS and AUR databases |
| trupg | `trizen -Syua` | Sync with repositories before upgrading all packages (from AUR too) | | trupg | `trizen -Syua` | Sync with repositories before upgrading all packages (from AUR too) |
| trsu | `trizen -Syua --noconfirm` | Same as `trupg`, but without confirmation | | trsu | `trizen -Syua --no-confirm` | Same as `trupg`, but without confirmation |
| upgrade[¹](#f1) | `trizen -Syu` | Sync with repositories before upgrading packages | | upgrade[¹](#f1) | `trizen -Syu` | Sync with repositories before upgrading packages |
#### Yay #### Yay
@@ -152,7 +152,7 @@ upgrades were available. Use `pacman -Que` instead.
| yareps | `yay -Ss` | Search for packages in the repositories | | yareps | `yay -Ss` | Search for packages in the repositories |
| yaupd | `yay -Sy` | Update and refresh local package, ABS and AUR databases | | yaupd | `yay -Sy` | Update and refresh local package, ABS and AUR databases |
| yaupg | `yay -Syu` | Sync with repositories before upgrading packages | | yaupg | `yay -Syu` | Sync with repositories before upgrading packages |
| yasu | `yay -Syu --noconfirm` | Same as `yaupg`, but without confirmation | | yasu | `yay -Syu --no-confirm` | Same as `yaupg`, but without confirmation |
| upgrade[¹](#f1) | `yay -Syu` | Sync with repositories before upgrading packages | | upgrade[¹](#f1) | `yay -Syu` | Sync with repositories before upgrading packages |
--- ---
+2 -25
View File
@@ -1,30 +1,7 @@
## Fossil Plugin ## Fossil Plugin
This plugin adds completion support and prompt for fossil repositories. This plugin adds completion support and prompt for fossil repositories.
The prompt will display the current branch and status been dirty or clean.
To use it, add `fossil` to the plugins array in your .zshrc file:
```zsh
plugins=(... fossil)
``
This plugin provides a prompt function named `fossil_prompt_info` that
will display the current branch and if there are changes (dirty) or not (clean).
### Prompt segments
These variables control how the prompt function looks:
```
ZSH_THEME_FOSSIL_PROMPT_PREFIX="%{$fg_bold[blue]%}fossil:(%{$fg_bold[red]%}"
ZSH_THEME_FOSSIL_PROMPT_SUFFIX="%{$fg_bold[blue]%})"
ZSH_THEME_FOSSIL_PROMPT_DIRTY="%{$fg_bold[red]%}✖"
ZSH_THEME_FOSSIL_PROMPT_CLEAN="%{$fg_bold[green]%}✔"
```
You can override their values in your .zshrc file, anywhere after the
`source $ZSH/oh-my-zsh.sh` line.
### CONTRIBUTOR ### CONTRIBUTOR
- Jefferson González ([jgmdev](https://github.com/jgmdev))
- Jefferson González ([jgmdev](https://github.com/jgmdev))
+16 -24
View File
@@ -7,10 +7,10 @@ ZSH_THEME_FOSSIL_PROMPT_PREFIX="%{$fg_bold[blue]%}fossil:(%{$fg_bold[red]%}"
ZSH_THEME_FOSSIL_PROMPT_SUFFIX="%{$fg_bold[blue]%})" ZSH_THEME_FOSSIL_PROMPT_SUFFIX="%{$fg_bold[blue]%})"
# Text to display if the branch is dirty # Text to display if the branch is dirty
ZSH_THEME_FOSSIL_PROMPT_DIRTY="%{$fg_bold[red]%}✖" ZSH_THEME_FOSSIL_PROMPT_DIRTY=" %{$fg_bold[red]%}✖"
# Text to display if the branch is clean # Text to display if the branch is clean
ZSH_THEME_FOSSIL_PROMPT_CLEAN="%{$fg_bold[green]%}✔" ZSH_THEME_FOSSIL_PROMPT_CLEAN=" %{$fg_bold[green]%}✔"
function fossil_prompt_info() { function fossil_prompt_info() {
local branch=$(fossil branch current 2>&1) local branch=$(fossil branch current 2>&1)
@@ -25,35 +25,27 @@ function fossil_prompt_info() {
dirty="$ZSH_THEME_FOSSIL_PROMPT_DIRTY" dirty="$ZSH_THEME_FOSSIL_PROMPT_DIRTY"
fi fi
printf ' %s%s%s%s%s' \ printf '%s %s %s %s %s' \
"$ZSH_THEME_FOSSIL_PROMPT_PREFIX" \ "$ZSH_THEME_FOSSIL_PROMPT_PREFIX" \
"${branch:gs/%/%%}" \ "${branch:gs/%/%%}" \
"$dirty" \
"$ZSH_THEME_FOSSIL_PROMPT_SUFFIX" \ "$ZSH_THEME_FOSSIL_PROMPT_SUFFIX" \
"$dirty" \
"%{$reset_color%}" "%{$reset_color%}"
} }
function _fossil_prompt () { function _fossil_prompt () {
# Re-check each time, in case the theme rebuilds its prompt in precmd local current=`echo $PROMPT $RPROMPT | grep fossil`
if [ -z "$_FOSSIL_PROMPT" ] || [[ "$PROMPT$RPROMPT" != *fossil_prompt_info* ]]; then
# Use substitutions to work out what other plugins and themes have if [ "$_FOSSIL_PROMPT" = "" -o "$current" = "" ]; then
# done ahead of us so we don't duplicate their work. local _prompt=${PROMPT}
# local _rprompt=${RPROMPT}
# If $fossil_prompt_info isn't in the prompt strings already but we
# can find $git_prompt_info, put it immediately afterward so that local is_prompt=`echo $PROMPT | grep git`
# one or the other appears in the prompt. We're gambling that you
# aren't in a directory that's a checkout for both a Git repo and a if [ "$is_prompt" = "" ]; then
# Fossil repo. RPROMPT="$_rprompt"'$(fossil_prompt_info)'
# else
# Otherwise, add it to the right prompt, as before. PROMPT="$_prompt"'$(fossil_prompt_info) '
if [ "${PROMPT/fossil_prompt_info//}" = "$PROMPT" ]; then
PROMPT="${PROMPT/git_prompt_info/git_prompt_info)\$(fossil_prompt_info}"
fi
if [ "${RPROMPT/fossil_prompt_info//}" = "$RPROMPT" ]; then
RPROMPT="${RPROMPT/git_prompt_info/git_prompt_info)\$(fossil_prompt_info}"
fi
if [[ "$PROMPT$RPROMPT" != *fossil_prompt_info* ]]; then
RPROMPT+='$(fossil_prompt_info)'
fi fi
_FOSSIL_PROMPT="1" _FOSSIL_PROMPT="1"
-1
View File
@@ -113,7 +113,6 @@ plugins=(... kubectl)
| | | **Node management** | | | | **Node management** |
| kgno | `kubectl get nodes` | List the nodes in ps output format | | kgno | `kubectl get nodes` | List the nodes in ps output format |
| kgnosl | `kubectl get nodes --show-labels` | List the nodes in ps output format with labels | | kgnosl | `kubectl get nodes --show-labels` | List the nodes in ps output format with labels |
| kgnow | `kubectl get nodes --watch` | List the nodes, then watch for status changes (e.g. Ready/NotReady, cordoned, added or removed) |
| keno | `kubectl edit node` | Edit nodes resource from the default editor | | keno | `kubectl edit node` | Edit nodes resource from the default editor |
| kdno | `kubectl describe node` | Describe node resource in detail | | kdno | `kubectl describe node` | Describe node resource in detail |
| kdelno | `kubectl delete node` | Delete the node | | kdelno | `kubectl delete node` | Delete the node |
-1
View File
@@ -157,7 +157,6 @@ alias kcp='kubectl cp'
# Node Management # Node Management
alias kgno='kubectl get nodes' alias kgno='kubectl get nodes'
alias kgnosl='kubectl get nodes --show-labels' alias kgnosl='kubectl get nodes --show-labels'
alias kgnow='kubectl get nodes --watch'
alias keno='kubectl edit node' alias keno='kubectl edit node'
alias kdno='kubectl describe node' alias kdno='kubectl describe node'
alias kdelno='kubectl delete node' alias kdelno='kubectl delete node'
+3 -3
View File
@@ -28,10 +28,10 @@ lsk() {
# Example # Example
# sqs-send user user.json # sqs-send user user.json
sqs-send(){ sqs-send(){
if [ -z "$1" ] || [ -z "$2" ]; then if [ -z "$1" ]; then
echo "Use: sqs-send <queue> <payload>" >&2 echo "Use: sqs-send <queue> <payload>"
return 1 return 1
fi fi
curl -X POST "http://localhost:4566/000000000000/$1" -d "Action=SendMessage" -d "MessageBody=$(cat "$2")" curl -X POST "http://localhost:4566/000000000000/$1" -d "Action=SendMessage" -d "MessageBody=$(cat $2)"
} }
+1 -1
View File
@@ -110,7 +110,7 @@ EOF
echo "\tlaunch|play|pause|stop|rewind|resume|quit" echo "\tlaunch|play|pause|stop|rewind|resume|quit"
echo "\tmute|unmute\tMute or unmute $APP_NAME" echo "\tmute|unmute\tMute or unmute $APP_NAME"
echo "\tnext|previous\tPlay next or previous track" echo "\tnext|previous\tPlay next or previous track"
echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle." echo "\tshuf|shuffle [on|off|toggle]\tSet shuffled playback. Default: toggle. Note: toggle doesn't support the MiniPlayer."
echo "\tvol [0-100|up|down]\tGet or set the volume. 0 to 100 sets the volume. 'up' / 'down' increases / decreases by 10 points. No argument displays current volume." echo "\tvol [0-100|up|down]\tGet or set the volume. 0 to 100 sets the volume. 'up' / 'down' increases / decreases by 10 points. No argument displays current volume."
echo "\tplaying|status\tShow what song is currently playing in Music." echo "\tplaying|status\tShow what song is currently playing in Music."
echo "\tplaylist [playlist name]\t Play specific playlist" echo "\tplaylist [playlist name]\t Play specific playlist"
+8 -8
View File
@@ -153,34 +153,34 @@ function port_pro() {
# top10 of gain access to the ip address # top10 of gain access to the ip address
function accessip10() { function accessip10() {
awk '{counts[$(11)]+=1}; END {for(url in counts) print counts[url], url}' "$(retlog "$1")" awk '{counts[$(11)]+=1}; END {for(url in counts) print counts[url], url}' "$(retlog)"
} }
# top20 of Most Visited file or page # top20 of Most Visited file or page
function visitpage20() { function visitpage20() {
awk '{print $11}' "$(retlog "$1")" | sort | uniq -c | sort -nr | head -n 20 awk '{print $11}' "$(retlog)" | sort | uniq -c | sort -nr | head -n 20
} }
# top100 of Page lists the most time-consuming (more than 60 seconds) as well as the corresponding page number of occurrences # top100 of Page lists the most time-consuming (more than 60 seconds) as well as the corresponding page number of occurrences
function consume100() { function consume100() {
awk '($NF > 60 && $7~/\.php/){print $7}' "$(retlog "$1")" | sort -n | uniq -c | sort -nr | head -n 100 awk '($NF > 60 && $7~/\.php/){print $7}' "$(retlog)" | sort -n | uniq -c | sort -nr | head -n 100
# if django website or other website make by no suffix language # if django website or other website make by no suffix language
# awk '{print $7}' "$(retlog "$1")" | sort -n | uniq -c | sort -nr | head -n 100 # awk '{print $7}' "$(retlog)" | sort -n | uniq -c | sort -nr | head -n 100
} }
# Website traffic statistics (G) # Website traffic statistics (G)
function webtraffic() { function webtraffic() {
awk '{sum+=$10} END {print sum/1024/1024/1024}' "$(retlog "$1")" awk '{sum+=$10} END {print sum/1024/1024/1024}' "$(retlog)"
} }
# Statistical connections 404 # Statistical connections 404
function c404() { function c404() {
awk '($9 ~ /404/)' "$(retlog "$1")" | awk '{print $9,$7}' | sort awk '($9 ~ /404/)' "$(retlog)" | awk '{print $9,$7}' | sort
} }
# Statistical http status. # Statistical http status.
function httpstatus() { function httpstatus() {
awk '{counts[$(9)]+=1}; END {for(code in counts) print code, counts[code]}' "$(retlog "$1")" awk '{counts[$(9)]+=1}; END {for(code in counts) print code, counts[code]}' "$(retlog)"
} }
# Delete 0 byte file # Delete 0 byte file
@@ -211,5 +211,5 @@ function getip() {
# Second concurrent # Second concurrent
function conssec() { function conssec() {
awk '{if($9~/200|30|404/)COUNT[$4]++}END{for( a in COUNT) print a,COUNT[a]}' "$(retlog "$1")" | sort -k 2 -nr | head -n10 awk '{if($9~/200|30|404/)COUNT[$4]++}END{for( a in COUNT) print a,COUNT[a]}' "$(retlog)" | sort -k 2 -nr | head -n10
} }
+3 -23
View File
@@ -43,32 +43,12 @@ function _vi-mode-set-cursor-shape-for-keymap() {
printf $'\e[%d q' "${_shape}" printf $'\e[%d q' "${_shape}"
} }
autoload -Uz is-at-least function _visual-mode {
if is-at-least 5.3; then
# Visual mode doesn't change $KEYMAP, it only activates the region, so
# zle-keymap-select never runs when it starts or ends
function _vi-mode-zle-line-pre-redraw() {
if [[ "$KEYMAP" = vicmd ]] && (( REGION_ACTIVE )); then
[[ "$VI_KEYMAP" != visual ]] || return 0
typeset -g VI_KEYMAP=visual
elif [[ "$VI_KEYMAP" = visual ]]; then
typeset -g VI_KEYMAP=$KEYMAP
else
return 0
fi
_vi-mode-set-cursor-shape-for-keymap "$VI_KEYMAP"
}
autoload -Uz add-zle-hook-widget
add-zle-hook-widget zle-line-pre-redraw _vi-mode-zle-line-pre-redraw
else
# zle-line-pre-redraw needs zsh 5.3
function _visual-mode {
typeset -g VI_KEYMAP=visual typeset -g VI_KEYMAP=visual
_vi-mode-set-cursor-shape-for-keymap "$VI_KEYMAP" _vi-mode-set-cursor-shape-for-keymap "$VI_KEYMAP"
zle .visual-mode zle .visual-mode
} }
zle -N visual-mode _visual-mode zle -N visual-mode _visual-mode
fi
function _vi-mode-should-reset-prompt() { function _vi-mode-should-reset-prompt() {
# If $VI_MODE_RESET_PROMPT_ON_MODE_CHANGE is unset (default), dynamically # If $VI_MODE_RESET_PROMPT_ON_MODE_CHANGE is unset (default), dynamically