Skip to content

(TFECO-7366) Stacks: parse terraform-sources.json to support remote component sources #1030

(TFECO-7366) Stacks: parse terraform-sources.json to support remote component sources

(TFECO-7366) Stacks: parse terraform-sources.json to support remote component sources #1030

name: "Add Copyright Headers"
on:
pull_request_target:
types:
- opened
- reopened
- synchronize
- ready_for_review
workflow_dispatch: {}
jobs:
add-copyright-headers:
runs-on: ubuntu-latest
env:
HEAD_REF: ${{ github.event.pull_request.head.ref }}
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@eef61447b9ff4aafe5dcd4e0bbf5d482be7e7871 # v4.2.1
with:
ref: ${{ github.event.pull_request.head.ref }}
repository: ${{ github.event.pull_request.head.repo.full_name }}
- name: Set git identity
run: |-
git config user.name "hashicorp-copywrite[bot]"
git config user.email "110428419+hashicorp-copywrite[bot]@users.noreply.github.com"
- name: Setup Copywrite tool
uses: hashicorp/setup-copywrite@32638da2d4e81d56a0764aa1547882fc4d209636 # v1.1.3
- name: Add headers using Copywrite tool
run: copywrite headers
- name: Check if there are any changes
id: get_changes
run: echo "changed=$(git status --porcelain | wc -l)" >> $GITHUB_OUTPUT
- name: Push changes
if: steps.get_changes.outputs.changed != 0
run: |-
git add .
git commit -s -m "[COMPLIANCE] Add required copyright headers"
git push origin HEAD:$HEAD_REF