@@ -94,8 +94,29 @@ commands:
9494 command : |
9595 FILES=$(ls -1 << parameters.source >>/*.<< parameters.extension >> 2>/dev/null)
9696 gsutil cp -n $FILES << parameters.destination >>
97-
98-
97+ setup-github-bot :
98+ steps :
99+ - run :
100+ name : Install Dependencies
101+ command : |
102+ pip install PyJWT requests cryptography
103+ - gh/install
104+ - run :
105+ name : Generate token and setup git user
106+ command : |
107+ export GH_TOKEN=$(python .circleci/scripts/create_jwt.py)
108+ if [ -z "$GH_TOKEN" ]; then
109+ echo "Failed to generate GH_TOKEN"
110+ exit 1
111+ fi
112+ echo "export GH_TOKEN=\"${GH_TOKEN}\"" >> "$BASH_ENV"
113+ git config --global user.email "experimenter-ci-bot@mozilla.com"
114+ git config --global user.name "Experimenter CircleCI Bot"
115+ git remote set-url origin https://x-access-token:${GH_TOKEN}@github.com/b4handjr/experimenter.git
116+ gh auth setup-git
117+ gh auth status
118+ gh config set git_protocol https
119+ gh config set prompt disabled
99120jobs :
100121 check_experimenter_x86_64 :
101122 machine :
@@ -731,18 +752,8 @@ jobs:
731752 image : ubuntu-2204:2024.11.1
732753 docker_layer_caching : true
733754 steps :
734- - add_ssh_keys :
735- fingerprints :
736- - " 32:8e:72:0b:9a:a1:1c:b8:7e:90:e1:53:a3:73:68:47" # for git pushes from circleci, since relies on ssh
737755 - checkout
738- - gh/setup :
739- token : GH_EXTERNAL_CONFIG_TOKEN # for gh commands from circleci, since relies on user token, since por que no los dos?
740- - run :
741- name : Setup Git
742- command : |
743- git config --local user.name "dataops-ci-bot"
744- git config --local user.email "dataops+ci-bot@mozilla.com"
745- gh config set git_protocol https
756+ - setup-github-bot
746757 - run :
747758 name : Check for External Config Update
748759 command : |
@@ -775,18 +786,8 @@ jobs:
775786 image : ubuntu-2204:2024.11.1
776787 docker_layer_caching : true
777788 steps :
778- - add_ssh_keys :
779- fingerprints :
780- - " 32:8e:72:0b:9a:a1:1c:b8:7e:90:e1:53:a3:73:68:47" # for git pushes from circleci, since relies on ssh
781789 - checkout
782- - gh/setup :
783- token : GH_TOKEN # for gh commands from circleci, since relies on user token, since por que no los dos?
784- - run :
785- name : Setup Git
786- command : |
787- git config --local user.name "dataops-ci-bot"
788- git config --local user.email "dataops+ci-bot@mozilla.com"
789- gh config set git_protocol https
790+ - setup-github-bot
790791 - run :
791792 name : Check for Application Services update
792793 command : |
@@ -813,18 +814,8 @@ jobs:
813814 docker_layer_caching : true
814815 working_directory : ~/experimenter
815816 steps :
816- - add_ssh_keys :
817- fingerprints :
818- - " 32:8e:72:0b:9a:a1:1c:b8:7e:90:e1:53:a3:73:68:47" # for git pushes from circleci, since relies on ssh
819817 - checkout
820- - gh/setup :
821- token : GH_TOKEN # for gh commands from circleci, since relies on user token, since por que no los dos?
822- - run :
823- name : Setup Git
824- command : |
825- git config --local user.name "dataops-ci-bot"
826- git config --local user.email "dataops+ci-bot@mozilla.com"
827- gh config set git_protocol https
818+ - setup-github-bot
828819 - run :
829820 name : Check for external Update
830821 command : |
0 commit comments