Skip to content

Commit

Permalink
Merge pull request #132 from aserto-dev/topaz-templates
Browse files Browse the repository at this point in the history
Revise update_templates workflow
  • Loading branch information
ronenh committed Aug 28, 2024
2 parents aa503d7 + 29f6a72 commit fdd462d
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions .github/workflows/update_templates.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,19 @@ name: update_templates
on:
workflow_dispatch:
inputs:
version:
description: 'topaz version'
branch:
description: 'topaz branch to update from'
type: string
default: "main"
required: false

env:
VAULT_ADDR: https://vault.eng.aserto.com/
PR_BRANCH: topaz_templates_${{ inputs.branch }}
# If the source topaz branch isn't 'main', add a '[DO NOT MERGE]' prefix to the PR title
PR_TITLE: ${{ inputs.branch != 'main' && '[DO NOT MERGE] ' || '' }} Update topaz templates from ${{ inputs.branch }}
# If the source branch isn't 'main', create the PR as a draft
PR_DRAFT_FLAG: ${{ inputs.branch != 'main' && '--draft' || '' }}

jobs:
update:
Expand All @@ -20,7 +25,7 @@ jobs:

-
name: Read Configuration
uses: hashicorp/vault-action@v2
uses: hashicorp/vault-action@v3
id: vault
with:
url: https://vault.eng.aserto.com/
Expand All @@ -42,7 +47,7 @@ jobs:
uses: actions/checkout@v4
with:
repository: "aserto-dev/topaz"
ref: ${{ inputs.version }}
ref: ${{ inputs.branch }}
path: "./topaz"
token: ${READ_WRITE_TOKEN}

Expand All @@ -56,10 +61,10 @@ jobs:
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
new_branch: update_topaz_templates
new_branch: ${{ env.PR_BRANCH }}
message: Update static topaz template assets

- name: Prepare PR
run: gh pr create -H update_topaz_templates -B main --title 'Update topaz templates' --body 'Created by Github action'
run: gh pr create ${{ env.PR_DRAFT_FLAG }} -H ${{ env.PR_BRANCH }} -B main --title '${{ env.PR_TITLE }}' --body 'Created by Github action'
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.READ_WRITE_TOKEN }}

0 comments on commit fdd462d

Please sign in to comment.