Code Monkey home page Code Monkey logo

ansible-github-actions's Introduction

Ansible GitHub Actions

This provides a GitHub Action for linting Ansible code. Other actions may be added in the future.

Getting Started

Create a GitHub Action workflow in a private repository hosting Ansible playbooks with the following code in the default workflow:

workflow "Ansible" {
  resolves = "ansible-lint"
  on = "pull_request"
}

action "filter-to-pr-open-synced" {
  uses = "actions/bin/filter@master"
  args = "action 'opened|synchronize'"
}

action "ansible-lint" {
  uses = "evalytica/ansible-github-actions/[email protected]"
  needs = "filter-to-pr-open-synced"
  secrets = ["GITHUB_TOKEN"]
  env = {
    ANSIBLE_ACTION_WORKING_DIR = "."
  }
}

This Actions workflow will run ansible-lint against all playbooks in the root of the repository whenever a pull request is opened. Edit the GitHub Action environment variable ANSIBLE_ACTION_WORKING_DIR with the path to the subdirectory that contains the Ansible playbooks to lint.

Add a GitHub Secret named ANSIBLE_VAULT_PASSWORD to the action with the Ansible Vault password required to decrypt Vaulted variables in the targeted playbooks.

Actions

Lint Action

Runs ansible-lint against all playbooks. ansible-lint can be tuned using a configuration file located in the same directory as the playbooks.

ansible-github-actions's People

Contributors

aharden avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.