Skip to content

ADO#2212 - Update permissions in yaml file #5

ADO#2212 - Update permissions in yaml file

ADO#2212 - Update permissions in yaml file #5

name: Update README with Branch Name
on:
push:
branches:
- 'brittneek'
jobs:
update-readme:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Update README
run: |
BRANCH_NAME="${GITHUB_REF#refs/heads/}"
sed -i "s|/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FCustomer-Service-Conversational-Insights-with-Azure-OpenAI-Services%2CURRENT_BRANCH%2Finfrastructure%2FARM%2Fdeployment-template.json|/https%3A%2F%2Fraw.githubusercontent.com%2Fmicrosoft%2FCustomer-Service-Conversational-Insights-with-Azure-OpenAI-Services%$BRANCH_NAME%2Finfrastructure%2FARM%2Fdeployment-template.json|g" README.md
- name: Commit and push if changes
run: |
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add README.md
git commit -m "Update README with current branch name" || exit 0 # Exit gracefully if no changes
git push