From ce23f0bcc9d618c3b9dab6a7a313ccc586465014 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Thu, 15 Aug 2024 15:45:27 -0400 Subject: [PATCH 01/35] First try at github action --- .../workflows/update-arm-config-directory.yml | 45 +++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 .github/workflows/update-arm-config-directory.yml diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml new file mode 100644 index 0000000..333c469 --- /dev/null +++ b/.github/workflows/update-arm-config-directory.yml @@ -0,0 +1,45 @@ +name: Update Config in Other Repos + +on: + push: + branches: + - gogiputtar/testing_github_actions + +jobs: + update-config: + runs-on: ubuntu-latest + + steps: + - name: Checkout robot-config repo + uses: actions/checkout@v3 + + - name: Set up Git + run: | + git config --global user.name 'github-actions[bot]' + git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + + - name: Clone hebi-python-examples repo + run: git clone https://github.com/HebiRobotics/hebi-python-examples.git + + - name: Replace arm's config directory in hebi-python-examples + run: | + rm -rf hebi-python-examples/kits/arm/config + cp -r robot-config/arms/config hebi-python-examples/kits/arm/config + + - name: Commit and Push changes to hebi-python-examples + run: | + cd hebi-python-examples + git checkout -b update-config + git add kits/arm/config + git commit -m "Update config directory from robot-config" + git push origin update-config + + - name: Create Pull Request for hebi-python-examples + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.GITHUB_TOKEN }} + commit-message: "Update config directory from robot-config" + branch: update-config + base: gogiputtar/testing_github_actions + title: "Update config directory from robot-config" + body: "This PR updates the config directory from the latest version in the robot-config repository." From 2800dbe5bc3aa3fa08ce7e1f5ca0434c2ff184ca Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Thu, 15 Aug 2024 16:47:27 -0400 Subject: [PATCH 02/35] Added token --- .github/workflows/update-arm-config-directory.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 333c469..067c78a 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -37,7 +37,7 @@ jobs: - name: Create Pull Request for hebi-python-examples uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.GITHUB_TOKEN }} + token: ${{ secrets.HEBI-config-nair }} commit-message: "Update config directory from robot-config" branch: update-config base: gogiputtar/testing_github_actions From 4910e6e4a9f89d9a5a712594738c67670697e475 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Thu, 15 Aug 2024 16:55:29 -0400 Subject: [PATCH 03/35] changed path --- .github/workflows/update-arm-config-directory.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 067c78a..e7e6c54 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -24,7 +24,7 @@ jobs: - name: Replace arm's config directory in hebi-python-examples run: | rm -rf hebi-python-examples/kits/arm/config - cp -r robot-config/arms/config hebi-python-examples/kits/arm/config + cp -r arms/config hebi-python-examples/kits/arm/config - name: Commit and Push changes to hebi-python-examples run: | From 8c744290660ba960135fec65ed00a802d254d86b Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 10:53:03 -0400 Subject: [PATCH 04/35] new attempt --- .github/workflows/update-arm-config-directory.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index e7e6c54..4534d88 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -11,12 +11,12 @@ jobs: steps: - name: Checkout robot-config repo - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Git run: | - git config --global user.name 'github-actions[bot]' - git config --global user.email '41898282+github-actions[bot]@users.noreply.github.com' + git config --global user.name 'Github Actions robot-config auto-bot' + git config --global user.email 'developer@hebirobotics.com' - name: Clone hebi-python-examples repo run: git clone https://github.com/HebiRobotics/hebi-python-examples.git From 81b9b4a4e6307150c0a2b547adf680532d62cbeb Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 10:57:14 -0400 Subject: [PATCH 05/35] new kind of push --- .github/workflows/update-arm-config-directory.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 4534d88..06a7d99 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -32,7 +32,7 @@ jobs: git checkout -b update-config git add kits/arm/config git commit -m "Update config directory from robot-config" - git push origin update-config + git push https://${{ secrets.HEBI-config-nair }}@github.com/HebiRobotics/hebi-python-examples.git update-config - name: Create Pull Request for hebi-python-examples uses: peter-evans/create-pull-request@v5 From dc254eee0c974560b03e3360982c1253099e9305 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 11:04:02 -0400 Subject: [PATCH 06/35] created environment --- .github/workflows/update-arm-config-directory.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 06a7d99..a1be991 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -27,12 +27,14 @@ jobs: cp -r arms/config hebi-python-examples/kits/arm/config - name: Commit and Push changes to hebi-python-examples + env: + GITHUB_TOKEN: ${{ secrets.HEBI-config-nair }} run: | cd hebi-python-examples git checkout -b update-config git add kits/arm/config git commit -m "Update config directory from robot-config" - git push https://${{ secrets.HEBI-config-nair }}@github.com/HebiRobotics/hebi-python-examples.git update-config + git push origin update-config - name: Create Pull Request for hebi-python-examples uses: peter-evans/create-pull-request@v5 From f904cb0ef9392c4fbfa1f95075bb9da4ea86ee01 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 11:06:40 -0400 Subject: [PATCH 07/35] testing secret --- .github/workflows/test-secret.yml | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 .github/workflows/test-secret.yml diff --git a/.github/workflows/test-secret.yml b/.github/workflows/test-secret.yml new file mode 100644 index 0000000..e4ad4d7 --- /dev/null +++ b/.github/workflows/test-secret.yml @@ -0,0 +1,23 @@ +name: Test Secret + +on: + workflow_dispatch: # Allows you to manually trigger the workflow + +jobs: + test-secret: + runs-on: ubuntu-latest + + steps: + - name: Check if Secret is Set + run: echo "Secret is available!" + env: + TEST_SECRET: ${{ secrets.HEBI-config-nair }} + + - name: Attempt to Use the Secret + run: | + if [ -z "$TEST_SECRET" ]; then + echo "Secret is not set or is invalid" + exit 1 + else + echo "Secret is valid: $TEST_SECRET" + fi From 0602fc37463b4f6d07dbf7b284f4d28e185343ee Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 11:09:18 -0400 Subject: [PATCH 08/35] tetsing again --- .../workflows/update-arm-config-directory.yml | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 .github/workflows/update-arm-config-directory.yml diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml deleted file mode 100644 index a1be991..0000000 --- a/.github/workflows/update-arm-config-directory.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Update Config in Other Repos - -on: - push: - branches: - - gogiputtar/testing_github_actions - -jobs: - update-config: - runs-on: ubuntu-latest - - steps: - - name: Checkout robot-config repo - uses: actions/checkout@v4 - - - name: Set up Git - run: | - git config --global user.name 'Github Actions robot-config auto-bot' - git config --global user.email 'developer@hebirobotics.com' - - - name: Clone hebi-python-examples repo - run: git clone https://github.com/HebiRobotics/hebi-python-examples.git - - - name: Replace arm's config directory in hebi-python-examples - run: | - rm -rf hebi-python-examples/kits/arm/config - cp -r arms/config hebi-python-examples/kits/arm/config - - - name: Commit and Push changes to hebi-python-examples - env: - GITHUB_TOKEN: ${{ secrets.HEBI-config-nair }} - run: | - cd hebi-python-examples - git checkout -b update-config - git add kits/arm/config - git commit -m "Update config directory from robot-config" - git push origin update-config - - - name: Create Pull Request for hebi-python-examples - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.HEBI-config-nair }} - commit-message: "Update config directory from robot-config" - branch: update-config - base: gogiputtar/testing_github_actions - title: "Update config directory from robot-config" - body: "This PR updates the config directory from the latest version in the robot-config repository." From d947a969864c7d71c7999e7d48655a7bca4c3d40 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 11:19:16 -0400 Subject: [PATCH 09/35] why is this workflow not visible --- .github/workflows/test-secret.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/test-secret.yml b/.github/workflows/test-secret.yml index e4ad4d7..af73f24 100644 --- a/.github/workflows/test-secret.yml +++ b/.github/workflows/test-secret.yml @@ -1,4 +1,4 @@ -name: Test Secret +name: Test Secrets on: workflow_dispatch: # Allows you to manually trigger the workflow From 5ffe2ff56e269e99393f755782ef60d707853aef Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 11:21:22 -0400 Subject: [PATCH 10/35] test-secrets again --- .github/workflows/test-secret.yml | 5 +- .../workflows/update-arm-config-directory.yml | 47 +++++++++++++++++++ 2 files changed, 51 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/update-arm-config-directory.yml diff --git a/.github/workflows/test-secret.yml b/.github/workflows/test-secret.yml index af73f24..080c4c9 100644 --- a/.github/workflows/test-secret.yml +++ b/.github/workflows/test-secret.yml @@ -1,7 +1,10 @@ name: Test Secrets on: - workflow_dispatch: # Allows you to manually trigger the workflow + push: + branches: + - gogiputtar/testing_github_actions + # workflow_dispatch: # Allows you to manually trigger the workflow jobs: test-secret: diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml new file mode 100644 index 0000000..a1be991 --- /dev/null +++ b/.github/workflows/update-arm-config-directory.yml @@ -0,0 +1,47 @@ +name: Update Config in Other Repos + +on: + push: + branches: + - gogiputtar/testing_github_actions + +jobs: + update-config: + runs-on: ubuntu-latest + + steps: + - name: Checkout robot-config repo + uses: actions/checkout@v4 + + - name: Set up Git + run: | + git config --global user.name 'Github Actions robot-config auto-bot' + git config --global user.email 'developer@hebirobotics.com' + + - name: Clone hebi-python-examples repo + run: git clone https://github.com/HebiRobotics/hebi-python-examples.git + + - name: Replace arm's config directory in hebi-python-examples + run: | + rm -rf hebi-python-examples/kits/arm/config + cp -r arms/config hebi-python-examples/kits/arm/config + + - name: Commit and Push changes to hebi-python-examples + env: + GITHUB_TOKEN: ${{ secrets.HEBI-config-nair }} + run: | + cd hebi-python-examples + git checkout -b update-config + git add kits/arm/config + git commit -m "Update config directory from robot-config" + git push origin update-config + + - name: Create Pull Request for hebi-python-examples + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.HEBI-config-nair }} + commit-message: "Update config directory from robot-config" + branch: update-config + base: gogiputtar/testing_github_actions + title: "Update config directory from robot-config" + body: "This PR updates the config directory from the latest version in the robot-config repository." From 8c64b55df0a6ad64fc6baa4507b9a7c0782ace1d Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 11:34:43 -0400 Subject: [PATCH 11/35] on push --- .github/workflows/test-secret.yml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/test-secret.yml b/.github/workflows/test-secret.yml index 080c4c9..ec5b2e1 100644 --- a/.github/workflows/test-secret.yml +++ b/.github/workflows/test-secret.yml @@ -1,10 +1,10 @@ name: Test Secrets on: - push: - branches: - - gogiputtar/testing_github_actions - # workflow_dispatch: # Allows you to manually trigger the workflow + push: + branches: + - gogiputtar/testing_github_actions + # workflow_dispatch: # Allows you to manually trigger the workflow jobs: test-secret: From ee0a67c47220507384eba7d8b55fc3a86a41b2c4 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 11:57:21 -0400 Subject: [PATCH 12/35] new token name --- .github/workflows/test-secret.yml | 3 ++- .github/workflows/update-arm-config-directory.yml | 4 ++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/test-secret.yml b/.github/workflows/test-secret.yml index ec5b2e1..ba18ca8 100644 --- a/.github/workflows/test-secret.yml +++ b/.github/workflows/test-secret.yml @@ -14,7 +14,7 @@ jobs: - name: Check if Secret is Set run: echo "Secret is available!" env: - TEST_SECRET: ${{ secrets.HEBI-config-nair }} + TEST_SECRET: ${{ secrets.OTHER_REPO_PAT }} - name: Attempt to Use the Secret run: | @@ -24,3 +24,4 @@ jobs: else echo "Secret is valid: $TEST_SECRET" fi + diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index a1be991..52196e2 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -28,7 +28,7 @@ jobs: - name: Commit and Push changes to hebi-python-examples env: - GITHUB_TOKEN: ${{ secrets.HEBI-config-nair }} + GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | cd hebi-python-examples git checkout -b update-config @@ -39,7 +39,7 @@ jobs: - name: Create Pull Request for hebi-python-examples uses: peter-evans/create-pull-request@v5 with: - token: ${{ secrets.HEBI-config-nair }} + token: ${{ secrets.OTHER_REPO_PAT }} commit-message: "Update config directory from robot-config" branch: update-config base: gogiputtar/testing_github_actions From f1d6f3648d2734f826744164d20bcd3734fa5356 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 12:03:19 -0400 Subject: [PATCH 13/35] another try --- .github/workflows/test-secret.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/test-secret.yml b/.github/workflows/test-secret.yml index ba18ca8..22e40d9 100644 --- a/.github/workflows/test-secret.yml +++ b/.github/workflows/test-secret.yml @@ -24,4 +24,3 @@ jobs: else echo "Secret is valid: $TEST_SECRET" fi - From dca92af2d3cb58cb410374b71d902add8a5d4434 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 12:22:11 -0400 Subject: [PATCH 14/35] check validity --- .github/workflows/check-token-validity.yml | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/check-token-validity.yml diff --git a/.github/workflows/check-token-validity.yml b/.github/workflows/check-token-validity.yml new file mode 100644 index 0000000..048f2b0 --- /dev/null +++ b/.github/workflows/check-token-validity.yml @@ -0,0 +1,24 @@ +name: Check Token Validity + +on: + push: + branches: + - gogiputtar/testing_github_actions + # workflow_dispatch: # Allows you to manually trigger the workflow + +jobs: + check-token: + runs-on: ubuntu-latest + + steps: + - name: Check if token is valid + run: | + RESPONSE=$(curl -H "Authorization: token ${{ secrets.OTHER_REPO_PAT }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/user) + if echo "$RESPONSE" | grep -q "Bad credentials"; then + echo "Invalid Token" + exit 1 + else + echo "Token is valid" + fi From 2dfdc22c37b8cb5158a99997e64485110f8439cb Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 12:30:50 -0400 Subject: [PATCH 15/35] env reorder --- .github/workflows/check-token-validity.yml | 1 + .github/workflows/test-secret.yml | 4 ++-- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/check-token-validity.yml b/.github/workflows/check-token-validity.yml index 048f2b0..6b13f0a 100644 --- a/.github/workflows/check-token-validity.yml +++ b/.github/workflows/check-token-validity.yml @@ -12,6 +12,7 @@ jobs: steps: - name: Check if token is valid + TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | RESPONSE=$(curl -H "Authorization: token ${{ secrets.OTHER_REPO_PAT }}" \ -H "Accept: application/vnd.github.v3+json" \ diff --git a/.github/workflows/test-secret.yml b/.github/workflows/test-secret.yml index 22e40d9..e4356fe 100644 --- a/.github/workflows/test-secret.yml +++ b/.github/workflows/test-secret.yml @@ -13,10 +13,10 @@ jobs: steps: - name: Check if Secret is Set run: echo "Secret is available!" - env: - TEST_SECRET: ${{ secrets.OTHER_REPO_PAT }} - name: Attempt to Use the Secret + env: + TEST_SECRET: ${{ secrets.OTHER_REPO_PAT }} run: | if [ -z "$TEST_SECRET" ]; then echo "Secret is not set or is invalid" From 1be290ab5e4bc827eaf016a1335e7fb13d84b811 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 12:33:12 -0400 Subject: [PATCH 16/35] Retry --- .github/workflows/check-token-validity.yml | 1 - .../workflows/update-arm-config-directory.yml | 68 ++++++++++--------- 2 files changed, 36 insertions(+), 33 deletions(-) diff --git a/.github/workflows/check-token-validity.yml b/.github/workflows/check-token-validity.yml index 6b13f0a..048f2b0 100644 --- a/.github/workflows/check-token-validity.yml +++ b/.github/workflows/check-token-validity.yml @@ -12,7 +12,6 @@ jobs: steps: - name: Check if token is valid - TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | RESPONSE=$(curl -H "Authorization: token ${{ secrets.OTHER_REPO_PAT }}" \ -H "Accept: application/vnd.github.v3+json" \ diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 52196e2..337e79b 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -10,38 +10,42 @@ jobs: runs-on: ubuntu-latest steps: - - name: Checkout robot-config repo - uses: actions/checkout@v4 + - name: Checkout robot-config repo + uses: actions/checkout@v4 - - name: Set up Git - run: | - git config --global user.name 'Github Actions robot-config auto-bot' - git config --global user.email 'developer@hebirobotics.com' - - - name: Clone hebi-python-examples repo - run: git clone https://github.com/HebiRobotics/hebi-python-examples.git - - - name: Replace arm's config directory in hebi-python-examples - run: | - rm -rf hebi-python-examples/kits/arm/config - cp -r arms/config hebi-python-examples/kits/arm/config + - name: Set up Git + run: | + git config --global user.name 'Github Actions robot-config auto-bot' + git config --global user.email 'developer@hebirobotics.com' + + - name: Clone hebi-python-examples repo + env: + GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} + run: | + git clone https://github.com/HebiRobotics/hebi-python-examples.git + cd hebi-python-examples + git config --local credential.helper store + echo "https://${{ secrets.OTHER_REPO_PAT }}:@github.com" > ~/.git-credentials - - name: Commit and Push changes to hebi-python-examples - env: - GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} - run: | - cd hebi-python-examples - git checkout -b update-config - git add kits/arm/config - git commit -m "Update config directory from robot-config" - git push origin update-config + - name: Replace arm's config directory in hebi-python-examples + run: | + rm -rf hebi-python-examples/kits/arm/config + cp -r arms/config hebi-python-examples/kits/arm/config - - name: Create Pull Request for hebi-python-examples - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.OTHER_REPO_PAT }} - commit-message: "Update config directory from robot-config" - branch: update-config - base: gogiputtar/testing_github_actions - title: "Update config directory from robot-config" - body: "This PR updates the config directory from the latest version in the robot-config repository." + - name: Commit and Push changes to hebi-python-examples + run: | + cd hebi-python-examples + git checkout -b update-config + git add kits/arm/config + git commit -m "Update config directory from robot-config" + git push origin update-config + + - name: Create Pull Request for hebi-python-examples + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.OTHER_REPO_PAT }} + commit-message: "Update config directory from robot-config" + branch: update-config + base: gogiputtar/testing_github_actions + title: "Update config directory from robot-config" + body: "This PR updates the config directory from the latest version in the robot-config repository." From 9c22aeb4345d31ee03125a57e5f947ea2e226f2d Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 12:47:42 -0400 Subject: [PATCH 17/35] Should work --- .github/workflows/test-secret.yml | 26 ------- .../workflows/update-arm-config-directory.yml | 73 ++++++++++++++++++- 2 files changed, 71 insertions(+), 28 deletions(-) delete mode 100644 .github/workflows/test-secret.yml diff --git a/.github/workflows/test-secret.yml b/.github/workflows/test-secret.yml deleted file mode 100644 index e4356fe..0000000 --- a/.github/workflows/test-secret.yml +++ /dev/null @@ -1,26 +0,0 @@ -name: Test Secrets - -on: - push: - branches: - - gogiputtar/testing_github_actions - # workflow_dispatch: # Allows you to manually trigger the workflow - -jobs: - test-secret: - runs-on: ubuntu-latest - - steps: - - name: Check if Secret is Set - run: echo "Secret is available!" - - - name: Attempt to Use the Secret - env: - TEST_SECRET: ${{ secrets.OTHER_REPO_PAT }} - run: | - if [ -z "$TEST_SECRET" ]; then - echo "Secret is not set or is invalid" - exit 1 - else - echo "Secret is valid: $TEST_SECRET" - fi diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 337e79b..44a5fa8 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -7,7 +7,7 @@ on: jobs: update-config: - runs-on: ubuntu-latest + runs-on: ubuntu-latest # Latest Ubuntu steps: - name: Checkout robot-config repo @@ -18,6 +18,7 @@ jobs: git config --global user.name 'Github Actions robot-config auto-bot' git config --global user.email 'developer@hebirobotics.com' + # Python Examples - name: Clone hebi-python-examples repo env: GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} @@ -44,8 +45,76 @@ jobs: uses: peter-evans/create-pull-request@v5 with: token: ${{ secrets.OTHER_REPO_PAT }} + repository: HebiRobotics/hebi-python-examples commit-message: "Update config directory from robot-config" branch: update-config - base: gogiputtar/testing_github_actions + base: master + title: "Update config directory from robot-config" + body: "This PR updates the config directory from the latest version in the robot-config repository." + + - name: Clone hebi-python-examples repo + env: + GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} + run: | + git clone https://github.com/HebiRobotics/hebi-python-examples.git + cd hebi-python-examples + git config --local credential.helper store + echo "https://${{ secrets.OTHER_REPO_PAT }}:@github.com" > ~/.git-credentials + + - name: Replace arm's config directory in hebi-python-examples + run: | + rm -rf hebi-python-examples/kits/arm/config + cp -r arms/config hebi-python-examples/kits/arm/config + + - name: Commit and Push changes to hebi-python-examples + run: | + cd hebi-python-examples + git checkout -b update-config + git add kits/arm/config + git commit -m "Update config directory from robot-config" + git push origin update-config + + - name: Create Pull Request for hebi-python-examples + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.OTHER_REPO_PAT }} + repository: HebiRobotics/hebi-python-examples + commit-message: "Update config directory from robot-config" + branch: update-config + base: master + title: "Update config directory from robot-config" + body: "This PR updates the config directory from the latest version in the robot-config repository." + + # C++ Examples + - name: Clone hebi-cpp-examples repo + env: + GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} + run: | + git clone https://github.com/HebiRobotics/hebi-cpp-examples.git + cd hebi-cpp-examples + git config --local credential.helper store + echo "https://${{ secrets.OTHER_REPO_PAT }}:@github.com" > ~/.git-credentials + + - name: Replace arm's config directory in hebi-cpp-examples + run: | + rm -rf hebi-cpp-examples/kits/arm/config + cp -r arms/config hebi-cpp-examples/kits/arm/config + + - name: Commit and Push changes to hebi-cpp-examples + run: | + cd hebi-cpp-examples + git checkout -b update-config + git add kits/arm/config + git commit -m "Update config directory from robot-config" + git push origin update-config + + - name: Create Pull Request for hebi-cpp-examples + uses: peter-evans/create-pull-request@v5 + with: + token: ${{ secrets.OTHER_REPO_PAT }} + repository: HebiRobotics/hebi-cpp-examples + commit-message: "Update config directory from robot-config" + branch: update-config + base: master title: "Update config directory from robot-config" body: "This PR updates the config directory from the latest version in the robot-config repository." From 005b575e34c1aa3b9bf504cc372be1b1db0b56af Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 12:54:05 -0400 Subject: [PATCH 18/35] branch deletion --- .../workflows/update-arm-config-directory.yml | 56 ++++++++----------- 1 file changed, 22 insertions(+), 34 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 44a5fa8..fb1fdf2 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -6,8 +6,8 @@ on: - gogiputtar/testing_github_actions jobs: - update-config: - runs-on: ubuntu-latest # Latest Ubuntu + update-config-python: + runs-on: ubuntu-latest steps: - name: Checkout robot-config repo @@ -17,8 +17,8 @@ jobs: run: | git config --global user.name 'Github Actions robot-config auto-bot' git config --global user.email 'developer@hebirobotics.com' - - # Python Examples + + # --- Python Examples Update Section --- - name: Clone hebi-python-examples repo env: GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} @@ -27,6 +27,10 @@ jobs: cd hebi-python-examples git config --local credential.helper store echo "https://${{ secrets.OTHER_REPO_PAT }}:@github.com" > ~/.git-credentials + # Delete existing update-config branch if it exists + git fetch origin + git branch -D update-config || true + git push origin --delete update-config || true - name: Replace arm's config directory in hebi-python-examples run: | @@ -52,40 +56,20 @@ jobs: title: "Update config directory from robot-config" body: "This PR updates the config directory from the latest version in the robot-config repository." - - name: Clone hebi-python-examples repo - env: - GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} - run: | - git clone https://github.com/HebiRobotics/hebi-python-examples.git - cd hebi-python-examples - git config --local credential.helper store - echo "https://${{ secrets.OTHER_REPO_PAT }}:@github.com" > ~/.git-credentials + update-config-cpp: + runs-on: ubuntu-latest + needs: update-config-python - - name: Replace arm's config directory in hebi-python-examples - run: | - rm -rf hebi-python-examples/kits/arm/config - cp -r arms/config hebi-python-examples/kits/arm/config + steps: + - name: Checkout robot-config repo + uses: actions/checkout@v4 - - name: Commit and Push changes to hebi-python-examples + - name: Set up Git run: | - cd hebi-python-examples - git checkout -b update-config - git add kits/arm/config - git commit -m "Update config directory from robot-config" - git push origin update-config + git config --global user.name 'Github Actions robot-config auto-bot' + git config --global user.email 'developer@hebirobotics.com' - - name: Create Pull Request for hebi-python-examples - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.OTHER_REPO_PAT }} - repository: HebiRobotics/hebi-python-examples - commit-message: "Update config directory from robot-config" - branch: update-config - base: master - title: "Update config directory from robot-config" - body: "This PR updates the config directory from the latest version in the robot-config repository." - - # C++ Examples + # --- C++ Examples Update Section --- - name: Clone hebi-cpp-examples repo env: GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} @@ -94,6 +78,10 @@ jobs: cd hebi-cpp-examples git config --local credential.helper store echo "https://${{ secrets.OTHER_REPO_PAT }}:@github.com" > ~/.git-credentials + # Delete existing update-config branch if it exists + git fetch origin + git branch -D update-config || true + git push origin --delete update-config || true - name: Replace arm's config directory in hebi-cpp-examples run: | From 0b6552b7948ede863edb54c212a8eea009929d89 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 13:26:58 -0400 Subject: [PATCH 19/35] no peter --- .../workflows/update-arm-config-directory.yml | 29 +++++++------------ 1 file changed, 10 insertions(+), 19 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index fb1fdf2..e4bc5b9 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -46,19 +46,14 @@ jobs: git push origin update-config - name: Create Pull Request for hebi-python-examples - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.OTHER_REPO_PAT }} - repository: HebiRobotics/hebi-python-examples - commit-message: "Update config directory from robot-config" - branch: update-config - base: master - title: "Update config directory from robot-config" - body: "This PR updates the config directory from the latest version in the robot-config repository." + env: + GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} + run: | + cd hebi-python-examples + gh pr create --title "Update config directory from robot-config" --body "This PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master update-config-cpp: runs-on: ubuntu-latest - needs: update-config-python steps: - name: Checkout robot-config repo @@ -97,12 +92,8 @@ jobs: git push origin update-config - name: Create Pull Request for hebi-cpp-examples - uses: peter-evans/create-pull-request@v5 - with: - token: ${{ secrets.OTHER_REPO_PAT }} - repository: HebiRobotics/hebi-cpp-examples - commit-message: "Update config directory from robot-config" - branch: update-config - base: master - title: "Update config directory from robot-config" - body: "This PR updates the config directory from the latest version in the robot-config repository." + env: + GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} + run: | + cd hebi-cpp-examples + gh pr create --title "Update config directory from robot-config" --body "This PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master From 77a48b338a8d80948e35e6d02e0261ab2aeea139 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 13:35:06 -0400 Subject: [PATCH 20/35] changed branch to main --- .github/workflows/update-arm-config-directory.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index e4bc5b9..d751f3b 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -3,7 +3,7 @@ name: Update Config in Other Repos on: push: branches: - - gogiputtar/testing_github_actions + - main jobs: update-config-python: @@ -50,7 +50,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | cd hebi-python-examples - gh pr create --title "Update config directory from robot-config" --body "This PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master + gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master update-config-cpp: runs-on: ubuntu-latest @@ -96,4 +96,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | cd hebi-cpp-examples - gh pr create --title "Update config directory from robot-config" --body "This PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master + gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master From 1f0fd330c25ffcf8505ae4329afe017276cfd6c6 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 13:38:02 -0400 Subject: [PATCH 21/35] small change test --- .github/workflows/update-arm-config-directory.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index d751f3b..5347dd1 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -97,3 +97,5 @@ jobs: run: | cd hebi-cpp-examples gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master + + \ No newline at end of file From 0038e17fc94cb236a4c3fc2c08ae40ba02aa3528 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Fri, 16 Aug 2024 13:38:49 -0400 Subject: [PATCH 22/35] changed all branches to main --- .github/workflows/check-token-validity.yml | 2 +- .github/workflows/update-arm-config-directory.yml | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/check-token-validity.yml b/.github/workflows/check-token-validity.yml index 048f2b0..9f6ecf8 100644 --- a/.github/workflows/check-token-validity.yml +++ b/.github/workflows/check-token-validity.yml @@ -3,7 +3,7 @@ name: Check Token Validity on: push: branches: - - gogiputtar/testing_github_actions + - main # workflow_dispatch: # Allows you to manually trigger the workflow jobs: diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 5347dd1..ecbd891 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -96,6 +96,4 @@ jobs: GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | cd hebi-cpp-examples - gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master - - \ No newline at end of file + gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master \ No newline at end of file From e7fa546e4d0737ea70e923aa07395dd63751bf88 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Mon, 19 Aug 2024 10:21:55 -0400 Subject: [PATCH 23/35] testing check-token-included in update-arm strategy matrix used --- .github/workflows/check-token-validity.yml | 24 ----- .../workflows/update-arm-config-directory.yml | 88 +++++++------------ 2 files changed, 33 insertions(+), 79 deletions(-) delete mode 100644 .github/workflows/check-token-validity.yml diff --git a/.github/workflows/check-token-validity.yml b/.github/workflows/check-token-validity.yml deleted file mode 100644 index 9f6ecf8..0000000 --- a/.github/workflows/check-token-validity.yml +++ /dev/null @@ -1,24 +0,0 @@ -name: Check Token Validity - -on: - push: - branches: - - main - # workflow_dispatch: # Allows you to manually trigger the workflow - -jobs: - check-token: - runs-on: ubuntu-latest - - steps: - - name: Check if token is valid - run: | - RESPONSE=$(curl -H "Authorization: token ${{ secrets.OTHER_REPO_PAT }}" \ - -H "Accept: application/vnd.github.v3+json" \ - https://api.github.com/user) - if echo "$RESPONSE" | grep -q "Bad credentials"; then - echo "Invalid Token" - exit 1 - else - echo "Token is valid" - fi diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index ecbd891..57c3ff9 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -3,57 +3,32 @@ name: Update Config in Other Repos on: push: branches: - - main + - gogiputtar/testing_github_actions jobs: - update-config-python: + check-token: runs-on: ubuntu-latest steps: - - name: Checkout robot-config repo - uses: actions/checkout@v4 - - - name: Set up Git - run: | - git config --global user.name 'Github Actions robot-config auto-bot' - git config --global user.email 'developer@hebirobotics.com' - - # --- Python Examples Update Section --- - - name: Clone hebi-python-examples repo - env: - GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} + - name: Check if token is valid run: | - git clone https://github.com/HebiRobotics/hebi-python-examples.git - cd hebi-python-examples - git config --local credential.helper store - echo "https://${{ secrets.OTHER_REPO_PAT }}:@github.com" > ~/.git-credentials - # Delete existing update-config branch if it exists - git fetch origin - git branch -D update-config || true - git push origin --delete update-config || true + RESPONSE=$(curl -H "Authorization: token ${{ secrets.OTHER_REPO_PAT }}" \ + -H "Accept: application/vnd.github.v3+json" \ + https://api.github.com/user) + if echo "$RESPONSE" | grep -q "Bad credentials"; then + echo "Invalid Token" + exit 1 + else + echo "Token is valid" - - name: Replace arm's config directory in hebi-python-examples - run: | - rm -rf hebi-python-examples/kits/arm/config - cp -r arms/config hebi-python-examples/kits/arm/config - - - name: Commit and Push changes to hebi-python-examples - run: | - cd hebi-python-examples - git checkout -b update-config - git add kits/arm/config - git commit -m "Update config directory from robot-config" - git push origin update-config - - - name: Create Pull Request for hebi-python-examples - env: - GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} - run: | - cd hebi-python-examples - gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master - - update-config-cpp: + update-config: runs-on: ubuntu-latest + needs: check-token + + strategy: + fail-fast: false + matrix: + repo: [hebi-python-examples, hebi-cpp-examples] steps: - name: Checkout robot-config repo @@ -64,13 +39,13 @@ jobs: git config --global user.name 'Github Actions robot-config auto-bot' git config --global user.email 'developer@hebirobotics.com' - # --- C++ Examples Update Section --- - - name: Clone hebi-cpp-examples repo + # --- Clone Target Repo --- + - name: Clone ${{ matrix.repo }} repo env: GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | - git clone https://github.com/HebiRobotics/hebi-cpp-examples.git - cd hebi-cpp-examples + git clone https://github.com/HebiRobotics/${{ matrix.repo }}.git + cd ${{ matrix.repo }} git config --local credential.helper store echo "https://${{ secrets.OTHER_REPO_PAT }}:@github.com" > ~/.git-credentials # Delete existing update-config branch if it exists @@ -78,22 +53,25 @@ jobs: git branch -D update-config || true git push origin --delete update-config || true - - name: Replace arm's config directory in hebi-cpp-examples + # --- Replace Config Directory --- + - name: Replace arm's config directory in ${{ matrix.repo }} run: | - rm -rf hebi-cpp-examples/kits/arm/config - cp -r arms/config hebi-cpp-examples/kits/arm/config + rm -rf ${{ matrix.repo }}/kits/arm/config + cp -r arms/config ${{ matrix.repo }}/kits/arm/config - - name: Commit and Push changes to hebi-cpp-examples + # --- Commit and Push Changes --- + - name: Commit and Push changes to ${{ matrix.repo }} run: | - cd hebi-cpp-examples + cd ${{ matrix.repo }} git checkout -b update-config git add kits/arm/config git commit -m "Update config directory from robot-config" git push origin update-config - - name: Create Pull Request for hebi-cpp-examples + # --- Create Pull Request --- + - name: Create Pull Request for ${{ matrix.repo }} env: GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | - cd hebi-cpp-examples - gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master \ No newline at end of file + cd ${{ matrix.repo }} + gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master From ec2af13d0dffd4a92f726d13569f9f801d69536a Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Mon, 19 Aug 2024 10:32:34 -0400 Subject: [PATCH 24/35] new line --- .github/workflows/update-arm-config-directory.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 57c3ff9..1af0d2c 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -75,3 +75,5 @@ jobs: run: | cd ${{ matrix.repo }} gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master + + \ No newline at end of file From 0376d8a41e27398319da7d6fefd7c7c6dfeaa633 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Mon, 19 Aug 2024 10:39:08 -0400 Subject: [PATCH 25/35] added missing fi --- .github/workflows/update-arm-config-directory.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 1af0d2c..0e388cd 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -8,7 +8,7 @@ on: jobs: check-token: runs-on: ubuntu-latest - + steps: - name: Check if token is valid run: | @@ -20,7 +20,8 @@ jobs: exit 1 else echo "Token is valid" - + fi + update-config: runs-on: ubuntu-latest needs: check-token @@ -76,4 +77,3 @@ jobs: cd ${{ matrix.repo }} gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master - \ No newline at end of file From 1ee7d7ad16cde2a258f4c25f52df56d32427e4a9 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Mon, 19 Aug 2024 10:40:34 -0400 Subject: [PATCH 26/35] strategy matrix added which runs parallel processes --- .github/workflows/update-arm-config-directory.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 0e388cd..a7447ab 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -3,7 +3,7 @@ name: Update Config in Other Repos on: push: branches: - - gogiputtar/testing_github_actions + - main jobs: check-token: @@ -21,7 +21,7 @@ jobs: else echo "Token is valid" fi - + update-config: runs-on: ubuntu-latest needs: check-token From 63904d7daa73322ff120a3ce5cbf01cc3365d889 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Mon, 19 Aug 2024 13:08:33 -0400 Subject: [PATCH 27/35] removed helper store --- .github/workflows/update-arm-config-directory.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index a7447ab..77a7aa6 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -3,7 +3,7 @@ name: Update Config in Other Repos on: push: branches: - - main + - gogiputtar/testing_github_actions jobs: check-token: @@ -47,8 +47,6 @@ jobs: run: | git clone https://github.com/HebiRobotics/${{ matrix.repo }}.git cd ${{ matrix.repo }} - git config --local credential.helper store - echo "https://${{ secrets.OTHER_REPO_PAT }}:@github.com" > ~/.git-credentials # Delete existing update-config branch if it exists git fetch origin git branch -D update-config || true @@ -76,4 +74,3 @@ jobs: run: | cd ${{ matrix.repo }} gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master - From 431f3ca6d1f9fa8a0f9d4aee2d030096dc24d27f Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Mon, 19 Aug 2024 13:09:59 -0400 Subject: [PATCH 28/35] added token env to push --- .github/workflows/update-arm-config-directory.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 77a7aa6..0405a45 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -60,6 +60,8 @@ jobs: # --- Commit and Push Changes --- - name: Commit and Push changes to ${{ matrix.repo }} + env: + GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | cd ${{ matrix.repo }} git checkout -b update-config From aecb60e48c129aca4f79b04f06da765b0d5da85f Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Tue, 20 Aug 2024 14:41:01 -0400 Subject: [PATCH 29/35] included token in push command --- .github/workflows/update-arm-config-directory.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 0405a45..9aee79e 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -67,7 +67,7 @@ jobs: git checkout -b update-config git add kits/arm/config git commit -m "Update config directory from robot-config" - git push origin update-config + git push https://${{ secrets.OTHER_REPO_PAT }}@github.com/HebiRobotics/${{ matrix.repo }}.git update-config # --- Create Pull Request --- - name: Create Pull Request for ${{ matrix.repo }} From b681b8f8c390bcb90fe2a7de702774f4074256f7 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Tue, 20 Aug 2024 14:45:24 -0400 Subject: [PATCH 30/35] test again --- .github/workflows/update-arm-config-directory.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 9aee79e..874195b 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -76,3 +76,5 @@ jobs: run: | cd ${{ matrix.repo }} gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master + + \ No newline at end of file From 737cd057733fd8a05b58ca601ef5321fd77bd5af Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Tue, 20 Aug 2024 14:51:21 -0400 Subject: [PATCH 31/35] Added token to origin push --- .github/workflows/update-arm-config-directory.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 874195b..bd89247 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -50,7 +50,7 @@ jobs: # Delete existing update-config branch if it exists git fetch origin git branch -D update-config || true - git push origin --delete update-config || true + git push https://${{ secrets.OTHER_REPO_PAT }}@github.com/HebiRobotics/${{ matrix.repo }}.git origin --delete update-config || true # --- Replace Config Directory --- - name: Replace arm's config directory in ${{ matrix.repo }} @@ -77,4 +77,3 @@ jobs: cd ${{ matrix.repo }} gh pr create --title "Update config directory from robot-config" --body "This automated PR updates the config directory from the latest version in the robot-config repository." --head update-config --base master - \ No newline at end of file From 5e353cef2f5438056be4f475e45e347cbe1fcb57 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Tue, 20 Aug 2024 14:54:35 -0400 Subject: [PATCH 32/35] removed origin word --- .github/workflows/update-arm-config-directory.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index bd89247..7d975ce 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -50,7 +50,7 @@ jobs: # Delete existing update-config branch if it exists git fetch origin git branch -D update-config || true - git push https://${{ secrets.OTHER_REPO_PAT }}@github.com/HebiRobotics/${{ matrix.repo }}.git origin --delete update-config || true + git push https://${{ secrets.OTHER_REPO_PAT }}@github.com/HebiRobotics/${{ matrix.repo }}.git --delete update-config || true # --- Replace Config Directory --- - name: Replace arm's config directory in ${{ matrix.repo }} From 65f4058a21e2a9a36ea34f0f21cfd452c3e05a30 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Tue, 20 Aug 2024 14:55:40 -0400 Subject: [PATCH 33/35] removed one env --- .github/workflows/update-arm-config-directory.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index 7d975ce..e1a9a8e 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -42,8 +42,8 @@ jobs: # --- Clone Target Repo --- - name: Clone ${{ matrix.repo }} repo - env: - GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} + # env: + # GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | git clone https://github.com/HebiRobotics/${{ matrix.repo }}.git cd ${{ matrix.repo }} From 05b2485458796aaec891f4fa8f89ce3f97fa8988 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Tue, 20 Aug 2024 14:58:11 -0400 Subject: [PATCH 34/35] removed other env --- .github/workflows/update-arm-config-directory.yml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index e1a9a8e..bd8c5b4 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -42,8 +42,6 @@ jobs: # --- Clone Target Repo --- - name: Clone ${{ matrix.repo }} repo - # env: - # GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | git clone https://github.com/HebiRobotics/${{ matrix.repo }}.git cd ${{ matrix.repo }} @@ -60,8 +58,6 @@ jobs: # --- Commit and Push Changes --- - name: Commit and Push changes to ${{ matrix.repo }} - env: - GITHUB_TOKEN: ${{ secrets.OTHER_REPO_PAT }} run: | cd ${{ matrix.repo }} git checkout -b update-config From 6b7cb7438fbc473642e1720f1002e94d9abd5fb8 Mon Sep 17 00:00:00 2001 From: Aditya Nair Date: Tue, 20 Aug 2024 15:04:02 -0400 Subject: [PATCH 35/35] changed trigger branch to main --- .github/workflows/update-arm-config-directory.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-arm-config-directory.yml b/.github/workflows/update-arm-config-directory.yml index bd8c5b4..cce8e24 100644 --- a/.github/workflows/update-arm-config-directory.yml +++ b/.github/workflows/update-arm-config-directory.yml @@ -3,7 +3,7 @@ name: Update Config in Other Repos on: push: branches: - - gogiputtar/testing_github_actions + - main jobs: check-token: