From 351c29355de0bdf2b13e6b6edaa2162397c5b243 Mon Sep 17 00:00:00 2001 From: Sebastian Guaqueta Date: Tue, 17 Dec 2024 14:00:29 -0500 Subject: [PATCH] feat/ adding timestamp feature to branch name on devportal automation --- .github/workflows/devportal-update.yml | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/.github/workflows/devportal-update.yml b/.github/workflows/devportal-update.yml index 9172368..4a7d837 100644 --- a/.github/workflows/devportal-update.yml +++ b/.github/workflows/devportal-update.yml @@ -19,9 +19,13 @@ jobs: env: GITHUB_TOKEN: ${{ secrets.DEVPORTAL_DOCS_UPDATE_TOKEN }} run: | + TIMESTAMP=$(date +'%Y%m%d-%H%M%S') + BRANCH_NAME="update-from-foundry-starter-${TIMESTAMP}" + echo "BRANCH_NAME=${BRANCH_NAME}" >> $GITHUB_ENV + git clone https://github.com/rsksmart/devportal.git cd devportal - git checkout -b update-from-foundry-starter || git checkout update-from-foundry-starter + git checkout -b ${BRANCH_NAME} || git checkout ${BRANCH_NAME} cd .. # Step 2: Transform Each File and Copy to Devportal Repository @@ -60,7 +64,7 @@ jobs: git commit -m "Automated update from repository" # Configure the remote URL with the token for authentication git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/rsksmart/devportal.git - git push -f origin update-from-foundry-starter + git push -f origin ${BRANCH_NAME} # Step 4: Create a Pull Request in the Devportal Repository - name: Create Pull Request @@ -72,4 +76,4 @@ jobs: -H "Authorization: Bearer ${{ secrets.DEVPORTAL_DOCS_UPDATE_TOKEN }}" \ -H "X-GitHub-Api-Version: 2022-11-28" \ https://api.github.com/repos/rsksmart/devportal/pulls \ - -d '{"title":"rootstock-foundry-starterkit automated update of documentation","body":"This PR updates the Devportal documentation with the latest changes from the original repository.","head":"update-from-foundry-starter","base":"main"}' + -d '{"title":"rootstock-foundry-starterkit automated update of documentation ${BRANCH_NAME}","body":"This PR updates the Devportal documentation with the latest changes from the original repository.","head":"${BRANCH_NAME}","base":"main"}'