liveBook · Manning

Actionlint

As explained in GitHub Actions in Action: Continuous integration and delivery for DevOps

actionlint is a linter that statically checks GitHub Actions workflow files for syntax errors, configuration mistakes, and potentially unsafe expressions.

actionlint statically checks GitHub Actions workflow files for mistakes before they run. Used as a workflow step, it can surface configuration problems and flag expressions that may pass untrusted input into scripts. section 3.9 section 6.2

jobs:
  main:
    runs-on: ubuntu-latest
    permissions:
      contents: read
      pull-requests: write
    steps:
      - uses: actions/checkout@v3
      - uses: devops-actions/actionlint@v0.1.2

Add actionlint after repository checkout so pull requests can be checked and workflow-file changes annotated. section 3.9

Use it as part of layered workflow security:

  • Check values originating from untrusted sources, including branch names, issue titles, and pull-request bodies, before they reach run commands. section 6.2
  • Run automated and manual security checks before permitting jobs on contained, ephemeral self-hosted runners. section 6.2
  • Treat linting as an early safeguard rather than a replacement for environment protection rules, approvals, or runner isolation. section 6.2

Linting complements debugging: test deployment scripts locally or on a virtual machine first, then use step or runner debug logging when workflow behavior still needs investigation. section 3.9

How GitHub Actions in Action: Continuous integration and delivery for DevOps covers it

How deep it goes
Identifies linting integration and unsafe-input checks, but defers detailed rule configuration and implementation internals.
Examples
Shows an Ubuntu workflow job that checks out a repository and runs devops-actions/actionlint@v0.1.2.
What it assumes
Assumes familiarity with GitHub Actions workflow files and repository-based pull-request automation.
What you can do after
Apply it via a GitHub Action to detect unsafe untrusted-input use and workflow mistakes before execution.
How it connects
Connects GitHub Actions workflows with pull requests, self-hosted runners, environment protection rules, and debug logging.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of GitHub Actions in Action: Continuous integration and delivery for DevOps. The section links point to the parts of the book it draws on.