diff --git a/.github/workflows/codeql.yml b/.github/workflows/codeql.yml new file mode 100644 index 0000000..07291b1 --- /dev/null +++ b/.github/workflows/codeql.yml @@ -0,0 +1,45 @@ +name: "CodeQL" + +on: + push: + branches: [ "main" ] + pull_request: + branches: [ "main" ] + schedule: + - cron: '41 4 * * 4' + +jobs: + analyze: + name: Analyze (${{ matrix.language }}) + runs-on: ubuntu-latest + permissions: + # required for all workflows + security-events: write + + # required to fetch internal or private CodeQL packs + packages: read + + # only required for workflows in private repositories + actions: read + contents: read + + strategy: + fail-fast: false + matrix: + include: + - language: go + build-mode: autobuild + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Initialize CodeQL + uses: github/codeql-action/init@v3 + with: + languages: ${{ matrix.language }} + build-mode: ${{ matrix.build-mode }} + + - name: Perform CodeQL Analysis + uses: github/codeql-action/analyze@v3 + with: + category: "/language:${{matrix.language}}" diff --git a/.github/workflows/go.yml b/.github/workflows/go.yml new file mode 100644 index 0000000..efc71ce --- /dev/null +++ b/.github/workflows/go.yml @@ -0,0 +1,29 @@ +# This workflow will build a golang project +# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go + +name: Go + +on: + push: + branches: [ "main" ] + tags: [ "*" ] + pull_request: + branches: [ "main" ] + +jobs: + + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.22' + + - name: Build + run: go build -v ./... + + - name: Test + run: go test -v ./... diff --git a/README.md b/README.md index c0c5114..eca58f4 100644 --- a/README.md +++ b/README.md @@ -3,23 +3,27 @@ [![License: MIT](https://img.shields.io/badge/License-MIT%202.0-blue.svg)](https://github.com/sergkondr/docker-tree/blob/main/LICENSE) [![GitHub release](https://img.shields.io/github/release/sergkondr/docker-tree.svg)](https://github.com/sergkondr/docker-tree/releases/latest) [![Go Report Card](https://goreportcard.com/badge/github.com/sergkondr/docker-tree)](https://goreportcard.com/report/github.com/sergkondr/docker-tree) +[![Go](https://github.com/sergkondr/docker-tree/actions/workflows/go.yml/badge.svg)](https://github.com/sergkondr/docker-tree/actions/workflows/go.yml) +[![CodeQL](https://github.com/sergkondr/docker-ps/actions/workflows/codeql.yml/badge.svg)](https://github.com/sergkondr/docker-ps/actions/workflows/codeql.yml) - -This command shows the directory tree of a Docker image, like the 'tree' command. -Provide the image name and an optional tag or digest to view the file structure inside the image. +This command shows the directory tree of a Docker image, like the 'tree' command. +Provide the image name and an optional tag or digest to view the file structure inside the image. You can also specify a directory to see the file tree relative to this directory. -This is not a replacement for the amazing [Dive](https://github.com/wagoodman/dive) utility, but it works as a Docker plugin, so you might find it simpler and more convenient -Think of this app mainly as an attempt to understand how Docker images work and how to create Docker plugins. However, it does work, and I hope you find it useful. +This is not a replacement for the amazing [Dive](https://github.com/wagoodman/dive) utility, but it works as a Docker +plugin, so you might find it simpler and more convenient +Think of this app mainly as an attempt to understand how Docker images work and how to create Docker plugins. However, +it does work, and I hope you find it useful. ### Install + ``` mv ./docker-tree ~/.docker/cli-plugins/docker-tree ``` ### Usage + ```shell -# Absent image will be pulled automatically ➜ docker tree alpine:3.20 /etc/ssl processing image: alpine:3.20 ssl/