Skip to content

Commit

Permalink
feat: enhance template sync workflow with ASDF caching and installati…
Browse files Browse the repository at this point in the history
…on steps
  • Loading branch information
jaygridley committed Jan 13, 2025
1 parent 46674dc commit e0f3fa4
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 4 deletions.
31 changes: 29 additions & 2 deletions .github/workflows/template-sync.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,27 @@ jobs:
with:
token: ${{ steps.template-sync-app-token.outputs.token }}

- name: actions-template-sync
- name: Cache ASDF
uses: actions/cache@v4
id: asdf-cache
with:
path: ~/.asdf/
key: ${{ runner.os }}-asdf-${{ hashFiles('.tool-versions') }}
restore-keys: ${{ runner.os }}-asdf-

- name: Setup ASDF
uses: asdf-vm/actions/setup@v3
if: ${{ steps.asdf-cache.outputs.cache-hit == 'true' }}

- name: Install ASDF
uses: asdf-vm/actions/install@v3
if: ${{ steps.asdf-cache.outputs.cache-hit != 'true' }}

- name: Reshim installed ASDF tools
shell: bash
run: asdf reshim

- name: Sync universal-addon template
uses: AndreasAugustin/actions-template-sync@v2
with:
github_token: ${{ steps.template-sync-app-token.outputs.token }}
Expand All @@ -33,4 +53,11 @@ jobs:
pr_title: "feat(sync): sync universal-addon changes"
pr_commit_msg: "feat(sync): sync universal-addon changes"
is_pr_cleanup: true
is_keep_branch_on_pr_cleanup: true
is_allow_hooks: true
hooks: >
precommit:
commands:
- git restore --staged main.tf variables.tf README.md
- git checkout -- main.tf variables.tf README.md
- git add main.tf variables.tf README.md
- pre-commit run terraform_docs || true
3 changes: 1 addition & 2 deletions .templatesyncignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,5 @@ examples/basic/main.tf
main.tf
addon-oidc.tf
variables.tf
variables-oidc.tf
README.md
variables-addon-oidc.tf
.secrets.baseline

0 comments on commit e0f3fa4

Please sign in to comment.