Skip to content

Commit

Permalink
gen: fixed template for declarative workflow (#336)
Browse files Browse the repository at this point in the history
  • Loading branch information
giautm authored Nov 18, 2024
1 parent 73a3917 commit 1ff8482
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 4 deletions.
4 changes: 0 additions & 4 deletions gen/declarative.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,7 @@ on:
jobs:
plan:
if: {{`${{ github.event_name == 'pull_request' }}`}}
{{- if not .Env.HasDevURL }}
{{- template "job-setup" . }}
{{- end }}
- uses: ariga/atlas-action/schema/plan@v1
with:
{{- if .From }}
Expand All @@ -38,9 +36,7 @@ jobs:
{{- end }}
apply:
if: {{`${{ github.event_name == 'push' && github.ref == 'refs/heads/`}}{{ .DefaultBranch }}{{`' }}`}}
{{- if not .Env.HasDevURL }}
{{- template "job-setup" . }}
{{- end }}
- uses: ariga/atlas-action/schema/plan/approve@v1
id: plan-approve
with:
Expand Down
20 changes: 20 additions & 0 deletions gen/testdata/declarative/plan_has_file_config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,32 @@ permissions:
jobs:
plan:
if: ${{ github.event_name == 'pull_request' }}
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ariga/setup-atlas@v0
with:
cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN_X1 }}
- uses: ariga/atlas-action/schema/plan@v1
with:
config: 'file://atlas.hcl'
env: 'prod'
apply:
if: ${{ github.event_name == 'push' && github.ref == 'refs/heads/master' }}
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ github.token }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: ariga/setup-atlas@v0
with:
cloud-token: ${{ secrets.ATLAS_CLOUD_TOKEN_X1 }}
- uses: ariga/atlas-action/schema/plan/approve@v1
id: plan-approve
with:
Expand Down

0 comments on commit 1ff8482

Please sign in to comment.