name: HashiCorp Copywrite

on:
  schedule:
    - cron: '30 2 * * *'
  pull_request:
    branches:
      - main
  push:
    branches:
      - main
  workflow_dispatch:

jobs:
  copywrite:
    runs-on: ubuntu-latest
    steps:
    - name: Checkout repository
      uses: actions/checkout@0ad4b8fadaa221de15dcec353f45205ec38ea70b # v4.1.4

    - name: Install copywrite
      uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3

    - name: Validate Header Compliance
      run: copywrite headers --plan
