Skip to content

update_templates

update_templates #98

name: update_templates
on:
workflow_dispatch:
inputs:
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:
runs-on: ubuntu-latest
steps:
-
uses: actions/checkout@v4
-
name: Read Configuration
uses: hashicorp/vault-action@v3
id: vault
with:
url: https://vault.eng.aserto.com/
token: ${{ secrets.VAULT_TOKEN }}
secrets: |
kv/data/github "SSH_PRIVATE_KEY" | SSH_PRIVATE_KEY;
kv/data/github "READ_WRITE_TOKEN" | READ_WRITE_TOKEN;
- name: Setup git
run: |
mkdir -p $HOME/.ssh
umask 0077 && echo -e "${SSH_PRIVATE_KEY}" > $HOME/.ssh/id_rsa
ssh-keyscan github.com >> $HOME/.ssh/known_hosts
git config --global url."git@github.com:".insteadOf https://github.com/
git config --global user.email "github-bot@aserto.com"
git config --global user.name "Aserto Bot"
- name: Get topaz
uses: actions/checkout@v4
with:
repository: "aserto-dev/topaz"
ref: ${{ inputs.branch }}
path: "./topaz"
token: ${READ_WRITE_TOKEN}
- name: Copy assets
run: |
cp -r ./topaz/assets/* static/assets/templates/
rm static/assets/templates/*.gif
rm -rf ./topaz
- name: Commit changes
uses: EndBug/add-and-commit@v9
with:
default_author: github_actions
new_branch: ${{ env.PR_BRANCH }}
message: Update static topaz template assets
- name: Prepare PR
run: gh pr create ${{ enf.PR_DRAFT_FLAG }} -H ${{ env.PR_BRANCH }} -B main --title '${{ env.PR_TITLE }}' --body 'Created by Github action'

Check failure on line 68 in .github/workflows/update_templates.yaml

View workflow run for this annotation

GitHub Actions / update_templates

Invalid workflow file

The workflow is not valid. .github/workflows/update_templates.yaml (Line: 68, Col: 14): Unrecognized named-value: 'enf'. Located at position 1 within expression: enf.PR_DRAFT_FLAG
env:
GITHUB_TOKEN: ${{ steps.vault.outputs.READ_WRITE_TOKEN }}