-
Notifications
You must be signed in to change notification settings - Fork 24
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
chore: disable terraform-docs push when on forks and sign commit
- Loading branch information
Showing
1 changed file
with
18 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,6 +5,11 @@ on: | |
jobs: | ||
ci: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
# Give the default GITHUB_TOKEN write permission to commit and push the | ||
# added or changed files to the repository. | ||
contents: write | ||
|
||
steps: | ||
# Setup dependencies | ||
- uses: actions/checkout@v4 | ||
|
@@ -34,5 +39,17 @@ jobs: | |
output-method: inject | ||
fail-on-diff: true | ||
args: --lockfile=false | ||
git-push: "true" # automatically push the changes to the branch | ||
git-push: 'false' | ||
|
||
# Push Terraform-docs changes | ||
- uses: planetscale/[email protected] | ||
# Run this step even if previous steps fails (there are changes to commit) | ||
# but skip when on forks | ||
if: ${{ !cancelled() && github.repository_owner == 'runatlantis' }} | ||
with: | ||
commit_message: "terraform-docs: automated action" | ||
repo: ${{ github.repository }} | ||
branch: ${{ github.head_ref || github.ref_name }} | ||
file_pattern: 'README.md' | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |