Skip to content

Commit

Permalink
Add auto generate script.ci
Browse files Browse the repository at this point in the history
  • Loading branch information
tungbq committed May 4, 2024
1 parent 1199d8d commit 984d583
Showing 1 changed file with 61 additions and 0 deletions.
61 changes: 61 additions & 0 deletions .github/workflows/generate-az-content.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
# The current workflow schedule approach:
# - Run the workflow on PR events to avoid breakage in generate content (not propose PR for doc updates at this point)
# - Repo owners will manually run the workflow to create the PR to update README.md content based on services json definition

name: Generate Azure Service Content

on:
pull_request:
branches:
- main
paths:
- 'az_services.json'
workflow_dispatch:
push:
branches:
- main
paths:
- 'az_services.json'
jobs:
generate_azure_content:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Install jq
run: sudo apt-get install jq -y

- name: Generate Content
run: set -e; bash generate-content.sh

- name: Commit changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git status
git add .
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
else
git commit -m "[bot] Generate doc content for Azure services" --no-verify
fi
- name: Create pull request
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' }}
id: cpr
uses: peter-evans/create-pull-request@v5
with:
token: ${{ secrets.GITHUB_TOKEN }}
commit-message: Update document
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
signoff: false
branch: update-doc-patches
branch-suffix: random
delete-branch: true
title: '[bot] Generate doc content for Azure services'
body: |
Updated the main document
- Auto-generated by [https://github.com/peter-evans/create-pull-request]

0 comments on commit 984d583

Please sign in to comment.