name: Run Ansible Lint in Container 

on:
  pull_request:
    branches: ["main", "stable", "release/v*"]
    paths:
      - '**/*.yaml'
      - '**/*.yml'
  workflow_dispatch:
    branches:
      - main

jobs:
  ansible-lint:
    runs-on: ubuntu-latest

    container:
      image: images.onwalk.net/public/base/alpine-ansible-ci-runner:0c09618

    steps:
      - name: Checkout code
        uses: actions/checkout@v2

      - name: Run ansible-lint
        run: echo ${{ secrets.VAULT_PASSWORD }} > ~/.vault_password && ansible-lint
