I have a github workflow file where I’m using sed to replace variables within a configuration file, code below. The error i’m getting is with the GA_MP_SECRET line:
Run sed -i 's/${GA_MP_SECRET}/***/g' configs/myworkflow.yaml
sed: -e expression #1, char 53: unknown option to `s'
At first I thought the path being inserted with ${{ env.CONTAINER_APP_YAML }} might be causing an issue due to the slash, but the first three sed lines (under “Modify app yaml basics”) don’t cause an error.
The VERY weird part is that I tried moving consolidating all the sed lines from “Modify app yaml secrets” up underneath the ‘Modify app yaml basics’ sed lines, and suddenly the IMAGE_TAG sed line breaks. Same error. Yes, the line that didn’t cause an error before.
I figured there must be a hidden character or something breaking this, but I can’t track anything down. Any advice? I’ve been trying to fix this for four hours, and very frustrated!
The workflow file:
jobs:
build:
runs-on: ubuntu-latest
environment: dev
env:
CONTAINER_APP_NAME: software-api-test
LOCATION: central_us
RESOURCE_GROUP: softwareDevRg
ACR_NAME: softwareacr
CONTAINER_APP_YAML: "configs/myworkflow.yaml"
steps:
- uses: actions/checkout@v2
- name: Log into Azure
uses: azure/login@v2
with:
client-id: ${{ secrets.AZURE_CLIENT_ID }}
tenant-id: ${{ secrets.AZURE_TENANT_ID }}
subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }}
- name: Modify app yaml basics
run: |
sed -i 's/${IMAGE_TAG}/${{ github.sha }}/g' ${{ env.CONTAINER_APP_YAML }}
sed -i 's/${CONTAINER_APP_NAME}/${{ env.CONTAINER_APP_NAME }}/g' ${{ env.CONTAINER_APP_YAML }}
sed -i 's/${RESOURCE_GROUP}/${{ env.RESOURCE_GROUP }}/g' ${{ env.CONTAINER_APP_YAML }}
- name: Modify app yaml secrets
run: |
sed -i 's/${GA_MP_SECRET}/${{ secrets.GA_MP_SECRET }}/g' ${{ env.CONTAINER_APP_YAML }}
sed -i 's/${FB_ACCESS_TOKEN}/${{ secrets.FB_ACCESS_TOKEN }}/g' ${{ env.CONTAINER_APP_YAML }}