Skip to content

Update testworkflow.yml #23

Update testworkflow.yml

Update testworkflow.yml #23

Workflow file for this run

# This workflow will build a golang project
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
name: Mock deploy workflow
on:
push:
branches: [ "master" ]
#pull_request:
# branches: [ "master" ]
workflow_dispatch:
inputs:
deployment_type:
description: 'Type of deployment'
required: true
default: "Development"
type: choice
options:
- Development
- Test
- Staging
- Production
env:
LOG_LEVEL: |
${{ fromJson('{ Development: "DEBUG", Production: "INFO" }')[github.event.inputs.deployment_type] }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.20'
- name: Build
run: echo 'Build some stuff'
- name: Test
run: echo 'Testing some stuff'
deploy:
runs-on: ubuntu-latest
needs: build
environment: ${{ github.event.inputs.deployment_type || "Dev" }}

Check failure on line 45 in .github/workflows/testworkflow.yml

View workflow run for this annotation

GitHub Actions / Mock deploy workflow

Invalid workflow file

The workflow is not valid. .github/workflows/testworkflow.yml (Line: 45, Col: 18): Unexpected symbol: '"Dev"'. Located at position 40 within expression: github.event.inputs.deployment_type || "Dev" .github/workflows/testworkflow.yml (Line: 48, Col: 12): Unexpected symbol: '"Dev"'. Located at position 40 within expression: github.event.inputs.deployment_type || "Dev"
steps:
- name: Output deploy type
run: echo 'Deploy type';echo '${{ github.event.inputs.deployment_type || "Dev" }}'
- name: Mock environmment deploy
run: echo "Deploy to ${{ vars.ACCOUNT_ID }} with log level $LOG_LEVEL. Shhh the secret is ${{ secrets.SECRET_PASSWORD_TEST }} (GitHub obsfucates this)"