Skip to content

Commit

Permalink
feat: sync doc github action
Browse files Browse the repository at this point in the history
  • Loading branch information
RamyEB committed Jan 8, 2024
1 parent fbf9272 commit f96d9f2
Showing 1 changed file with 11 additions and 16 deletions.
27 changes: 11 additions & 16 deletions .github/workflows/sync_doc_devportal.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
name: Create Pull Request to DevPortal's repo

on: workflow_dispatch
# push:
# branches:
# - main
# paths:
# - "apps/docs/pages/APIs/wallet-api/*"
# - "apps/docs/pages/docs/discover/*"
on:
push:
branches:
- main
paths:
- "apps/docs/pages/APIs/wallet-api/*"
- "apps/docs/pages/docs/discover/*"

jobs:
syncAndCreatePR:
Expand Down Expand Up @@ -41,7 +41,7 @@ jobs:
run: |
git clone --depth 1 https://${DEVELOPER_PORTAL_CI_TOKEN}@${SOURCE_REPO}
git clone --depth 1 https://ldg-github-ci:${DEVELOPER_PORTAL_CI_TOKEN}@${TARGET_REPO}
PR_BRANCH_NAME=sync-discover-doc-$(date +%s)
PR_BRANCH_NAME=sync-discover-doc-$(date +%d-%m-%H-%M)
cd ${TARGET_REPO_NAME}
git checkout -b ${PR_BRANCH_NAME}
Expand All @@ -57,21 +57,16 @@ jobs:
git push origin ${PR_BRANCH_NAME}
# Create Pull Request
JSON_PAYLOAD="{\"title\":\"${PR_TITLE}\",\"head\":\"${PR_BRANCH_NAME}\",\"base\":\"${TARGET_BRANCH}\"}"
JSON_PAYLOAD="{\"title\":\"${PR_TITLE}-$(date +%d-%m-%H-%M)\",\"head\":\"${PR_BRANCH_NAME}\",\"base\":\"${TARGET_BRANCH}\"}"
PR_RESPONSE=$(curl -X POST -H "Authorization: token ${DEVELOPER_PORTAL_CI_TOKEN}" -d "$JSON_PAYLOAD" ${TARGET_PR_API_URL})
echo "PR_RESPONSE : $PR_RESPONSE "
PR_URL=$(echo $PR_RESPONSE | jq -r '.url')
PR_ISSUE_URL=$(echo $PR_RESPONSE | jq -r '.issue_url')
# Assign Reviewers
curl -s -X POST -H "Authorization: token ${DEVELOPER_PORTAL_CI_TOKEN}" \
-d "$PR_REVIEWERS" \
${PR_URL}/requested_reviewers
curl -s -X POST -H "Authorization: token ${DEVELOPER_PORTAL_CI_TOKEN}" -d "$PR_REVIEWERS" ${PR_URL}/requested_reviewers
# Assign Users to the Pull Request
curl -s -X POST -H "Authorization: token ${DEVELOPER_PORTAL_CI_TOKEN}" \
-d "$PR_ASSIGN" \
${PR_ISSUE_URL}/assignees
curl -s -X POST -H "Authorization: token ${DEVELOPER_PORTAL_CI_TOKEN}" -d "$PR_ASSIGN" ${PR_URL}/assignees

2 comments on commit f96d9f2

@vercel
Copy link

@vercel vercel bot commented on f96d9f2 Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wallet-api – ./apps/docs

wallet-api-ledgerhq.vercel.app
wallet.api.live.ledger.com
wallet-api-git-main-ledgerhq.vercel.app

@vercel
Copy link

@vercel vercel bot commented on f96d9f2 Jan 8, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

wallet-api-wallet-api-tools – ./apps/wallet-api-tools

wallet-api-wallet-api-tools-git-main-ledgerhq.vercel.app
wallet-api-wallet-api-tools.vercel.app
wallet-api-wallet-api-tools-ledgerhq.vercel.app

Please sign in to comment.