name: "Terraform/OpenTofu PR Commenter" description: "Posts PR comments for Terraform or OpenTofu commands (init/plan/fmt/validate), compatible with Gitea and GitHub." author: "Trez" branding: icon: "message-square" color: "purple" inputs: commenter_type: description: "The Terraform/OpenTofu command type (e.g., init, plan, fmt, validate)" required: true commenter_input: description: "Captured stdout/stderr output of the Terraform/OpenTofu command" required: true commenter_exitcode: description: "Exit code of the Terraform/OpenTofu command" required: true working_dir: description: "Optional working directory relative to the repository root (e.g., cloudflare)" required: false github_token: description: "Token used for posting the comment (Gitea or GitHub)" required: true runs: using: "composite" steps: - name: Run Terraform/OpenTofu PR Commenter shell: bash run: | chmod +x "${{ github.action_path }}/tf-pr-comment.sh" "${{ github.action_path }}/tf-pr-comment.sh" \ "${{ inputs.commenter_type }}" \ "${{ inputs.commenter_input }}" \ "${{ inputs.commenter_exitcode }}" \ "${{ inputs.working_dir }}" env: GITHUB_TOKEN: ${{ inputs.github_token }} PR_NUMBER: ${{ env.PR_NUMBER }} PR_URL: ${{ env.PR_URL }} PR_COMMENTS_URL: ${{ env.PR_COMMENTS_URL }} PR_COMMENT_ID: ${{ env.PR_COMMENT_ID }} PR_COMMENT_URI: ${{ env.PR_COMMENT_URI }}