-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1 changed file
with
10 additions
and
13 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,16 @@ | ||
name: Sync CI changes | ||
name: Sync API Documentation Changes | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * *' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
|
||
jobs: | ||
create-and-merge-prs: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: write | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
@@ -24,11 +25,7 @@ jobs: | |
- name: Create PR from smoke-test to main | ||
id: create_pr_smoke_test | ||
run: | | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git checkout -b pr-smoke-test-to-main | ||
git push origin pr-smoke-test-to-main | ||
pr_number=$(gh pr create --base main --head pr-smoke-test-to-main --title "Daily PR from smoke-test to main" --body "Automated PR from smoke-test to main" --json number -q .number) | ||
pr_number=$(gh pr create --base main --head smoke-test --title "Daily PR from smoke-test to main" --body "Automated PR from smoke-test to main" | grep -o '[0-9]*') | ||
echo "PR number created: $pr_number" | ||
echo "pr_number=$pr_number" >> $GITHUB_ENV | ||
|
@@ -37,8 +34,8 @@ jobs: | |
pr_number=${{ env.pr_number }} | ||
echo "Waiting for checks on PR #$pr_number to pass" | ||
while true; do | ||
checks=$(gh pr checks "$pr_number" --json conclusion --jq '.conclusion') | ||
if [[ "$checks" == "SUCCESS" ]]; then | ||
checks=$(gh pr checks "$pr_number" | grep -o 'successful') | ||
if [[ "$checks" == "successful" ]]; then | ||
break | ||
fi | ||
echo "Checks still pending. Waiting..." | ||
|
@@ -56,7 +53,7 @@ jobs: | |
git checkout main | ||
git checkout -b pr-main-to-live | ||
git push origin pr-main-to-live | ||
pr_number_live=$(gh pr create --base live --head pr-main-to-live --title "Daily PR from main to live" --body "Automated PR from main to live" --json number -q .number) | ||
pr_number_live=$(gh pr create --base live --head pr-main-to-live --title "Daily PR from main to live" --body "Automated PR from main to live" | grep -o '[0-9]*') | ||
echo "PR number created for live: $pr_number_live" | ||
echo "pr_number_live=$pr_number_live" >> $GITHUB_ENV | ||
|
@@ -66,8 +63,8 @@ jobs: | |
pr_number_live=${{ env.pr_number_live }} | ||
echo "Waiting for checks on PR #$pr_number_live to pass" | ||
while true; do | ||
checks_live=$(gh pr checks "$pr_number_live" --json conclusion --jq '.conclusion') | ||
if [[ "$checks_live" == "SUCCESS" ]]; then | ||
checks_live=$(gh pr checks "$pr_number_live" | grep -o 'successful') | ||
if [[ "$checks_live" == "successful" ]]; then | ||
break | ||
fi | ||
echo "Checks still pending. Waiting..." | ||
|