Skip to content
harbor-frameworkPublic

About

Prototype/preview GitHub Actions for Harbor

Resources

Stars

0 stars

Watchers

0 watching

Forks

Latest commit

 

History

9 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Actions

Warning

This repository is a prototype and not meant for general use yet. Its actions and their inputs may change without notice.

GitHub Actions for Harbor datasets.

lint

Lints the task directories a pull request changes with harbor lint, putting findings on the pull request's lines, without running code from the pull request.

name: harbor lint
on: pull_request  # Never pull_request_target.
permissions:
  contents: read
jobs:
  lint:
    runs-on: ubuntu-latest
    steps:
      - uses: harbor-framework/actions/lint@<commit-sha>
        with:
          tasks: tasks/*                 # Or tasks/*/* for tasks in groups.
          dataset: tasks/dataset.toml
          harbor-version: "X.Y.Z"        # Or set it in .github/harbor-version.

It checks out the pull request's merge commit and its base commit separately. Harbor, dataset.toml and the dataset's rule files come from the base commit, and harbor lint --dangerously-trust-dataset --dataset trusts only that dataset; the pull request's tasks are only read. A changed task is a directory matching tasks with a task.toml or instruction.md, before or after the merge, and must not be a symlink or submodule or hold symlinks that leave it.

  • Runs on pull_request, on Linux runners only.
  • A task's own [metadata.harbor.lint] settings still apply; changes to them show in the pull request's diff.
  • GitHub shows only the first 10 annotations of a step inline, so the step summary lists every finding.
  • Protect the workflow file itself (for example with CODEOWNERS): on pull_request, a pull request can edit the workflow that calls this action.

Requires a Harbor release with dataset rules, --dataset and --dangerously-trust-dataset (harbor-framework/harbor#4506); until then, pin harbor-package to a commit.

Layout

  • lint/action.yml: the action.
  • lib/: helpers shared by actions, in Python's standard library only, run with python3 -I.
  • tests/: python3 -m unittest discover -s tests.
  • CI runs the tests and audits the workflows and actions with zizmor (pedantic); run it locally with uvx zizmor --persona pedantic ..

About

Prototype/preview GitHub Actions for Harbor

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages