From 57c9ec6d6f577eac941b4fa1d758d4cae589ae29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= <4975670+pavlovcik@users.noreply.github.com> Date: Sat, 23 Dec 2023 19:17:13 +0900 Subject: [PATCH 1/2] chore: update environment variable property names --- .github/workflows/release.yml | 4 ++-- .github/workflows/update-config.yml | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 3f366d621..fd84f4f64 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -21,8 +21,8 @@ jobs: uses: tibdex/github-app-token@v1.7.0 id: get_installation_token with: - app_id: ${{ secrets.UBIQUITY_BOUNTY_BOT_APP_ID }} - private_key: ${{ secrets.UBIQUITY_BOUNTY_BOT_PRIVATE_KEY }} + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} # diff --git a/.github/workflows/update-config.yml b/.github/workflows/update-config.yml index c93d04bfb..f9733fbd2 100644 --- a/.github/workflows/update-config.yml +++ b/.github/workflows/update-config.yml @@ -24,8 +24,8 @@ jobs: uses: tibdex/github-app-token@v1.7.0 id: get_installation_token with: - app_id: ${{ secrets.UBIQUITY_BOUNTY_BOT_APP_ID }} - private_key: ${{ secrets.UBIQUITY_BOUNTY_BOT_PRIVATE_KEY }} + app_id: ${{ secrets.APP_ID }} + private_key: ${{ secrets.APP_PRIVATE_KEY }} - name: Update Config Params and Create Pull Requests run: | From d5180e5649a0806e62a2b135d74c4d2a30a2bc43 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=82=A2=E3=83=AC=E3=82=AF=E3=82=B5=E3=83=B3=E3=83=80?= =?UTF-8?q?=E3=83=BC=2Eeth?= <4975670+pavlovcik@users.noreply.github.com> Date: Sat, 23 Dec 2023 21:24:46 +0900 Subject: [PATCH 2/2] chore: bump node to lts --- .github/workflows/build.yml | 2 +- .github/workflows/conventional-commits.yml | 1 - .github/workflows/qa-automation.yml | 35 -------- .github/workflows/update-config.yml | 98 ---------------------- .nvmrc | 2 +- package.json | 2 +- 6 files changed, 3 insertions(+), 137 deletions(-) delete mode 100644 .github/workflows/qa-automation.yml delete mode 100644 .github/workflows/update-config.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 973953d53..ae1b13c2f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -13,7 +13,7 @@ jobs: - name: Setup Node uses: actions/setup-node@v3 with: - node-version: "18.16.0" + node-version: "20.10.0" - name: Install run: yarn install diff --git a/.github/workflows/conventional-commits.yml b/.github/workflows/conventional-commits.yml index 6482cd5e2..1f943d1bb 100644 --- a/.github/workflows/conventional-commits.yml +++ b/.github/workflows/conventional-commits.yml @@ -3,7 +3,6 @@ name: Conventional Commits on: pull_request: push: - branches: [development] jobs: conventional-commits: diff --git a/.github/workflows/qa-automation.yml b/.github/workflows/qa-automation.yml deleted file mode 100644 index 2b8aafa53..000000000 --- a/.github/workflows/qa-automation.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Automate QA - -on: - pull_request_target: - types: - - review_requested - branches: [development, main] - -jobs: - add-to-project: - env: - ADD_TO_PROJECT_PAT: ${{ secrets.ADD_TO_PROJECT_PAT }} - name: Add issue to project - runs-on: ubuntu-latest - permissions: - contents: read - - steps: - - name: Add PR to QA project - if: contains(github.event.pull_request.requested_reviewers.*.login, 'Draeieg') - uses: actions/add-to-project@v0.5.0 - with: - project-url: https://github.com/orgs/ubiquity/projects/23 - github-token: ${{ env.ADD_TO_PROJECT_PAT }} - - - name: Create QA Issue - if: contains(github.event.pull_request.requested_reviewers.*.login, 'Draeieg') - uses: dacbd/create-issue-action@v1 - with: - token: ${{ env.ADD_TO_PROJECT_PAT }} - owner: ubiquibot - repo: staging - title: QA for ${{ github.event.pull_request.title }} - body: | - Testing pr ${{ github.event.pull_request.number }} diff --git a/.github/workflows/update-config.yml b/.github/workflows/update-config.yml deleted file mode 100644 index f9733fbd2..000000000 --- a/.github/workflows/update-config.yml +++ /dev/null @@ -1,98 +0,0 @@ -name: Pull Request Action -permissions: write-all -on: - workflow_dispatch: - -env: - GH_TOKEN: ${{ secrets.ADD_TO_PROJECT_PAT }} - -jobs: - build: - runs-on: ubuntu-latest - steps: - - - name: Check out repository - uses: actions/checkout@v3 - - - name: Install jq and yq - run: | - sudo apt-get -y install jq - sudo wget https://github.com/mikefarah/yq/releases/latest/download/yq_linux_amd64 -O /usr/bin/yq - sudo chmod +x /usr/bin/yq - - - name: Get UbiquiBot Token - uses: tibdex/github-app-token@v1.7.0 - id: get_installation_token - with: - app_id: ${{ secrets.APP_ID }} - private_key: ${{ secrets.APP_PRIVATE_KEY }} - - - name: Update Config Params and Create Pull Requests - run: | - urls=$(curl -sSL https://raw.githubusercontent.com/ubiquity/devpool-directory/development/projects.json | jq -r '.urls[]') - - for url in $urls - do - repoName=$(basename $url) - ownerName=$(echo $url | awk -F/ '{print $(NF-1)}') - - git clone $url $repoName - cd $repoName - defaultBranch=$(git branch --show-current) - - # make a branch to update config # - git branch update - git checkout update - - curl -sSL https://raw.githubusercontent.com/ubiquity/ubiquibot/development/ubiquibot-config-default.json > default.json - declare -A param_mapping=( - ["evm-network-id"]="network-id chain-id" - ["price-multiplier"]="base-multiplier" - #add more configs as needed - ) - - ### update configs ### - # Iterate over the mapping and perform updates using sed - for new_param in "${!param_mapping[@]}" - do - old_params="${param_mapping[$new_param]}" - for old_param in $old_params - do - # only update param if the old ones exist - exist_old_param=$(yq "has(\"$old_param\")" .github/ubiquibot-config.yml) - if $exist_old_param; then - yq ".$new_param = .$old_param | del(.$old_param)" .github/ubiquibot-config.yml > temp.yml - mv temp.yml .github/ubiquibot-config.yml - fi - done - # if new param still doesent exist add default from ubiquibot-config-default.json - exist_new_param=$(yq "has(\"$new_param\")" .github/ubiquibot-config.yml) - if ! $exist_new_param; then - echo adding - def_val=$(jq -r ".[\"$new_param\"]" ubiquibot-config-default.json) - yq ".$new_param=$def_val" .github/ubiquibot-config.yml > temp.yml - mv temp.yml .github/ubiquibot-config.yml - fi - done - - git config user.email "113181824+UbiquiBot[bot]@users.noreply.github.com" - git config user.name "UbiquiBot[bot]" - - git add .github/ubiquibot-config.yml - git commit -m "build: use latest ubiquibot config setup" - git remote set-url origin https://${{ secrets.ADD_TO_PROJECT_PAT }}@github.com/$ownerName/$repoName.git - git push -f origin update - - curl -L \ - -X POST \ - -H "Accept: application/vnd.github+json" \ - -H "Authorization: Bearer ${{ steps.get_installation_token.outputs.token }}"\ - -H "X-GitHub-Api-Version: 2022-11-28" \ - https://api.github.com/repos/$ownerName/$repoName/pulls \ - -d '{ - "title": "build: use latest ubiquibot config setup", - "base": "'"$defaultBranch"'", - "head": "update" - }' - cd .. - done \ No newline at end of file diff --git a/.nvmrc b/.nvmrc index a5e8bba26..790e1105f 100644 --- a/.nvmrc +++ b/.nvmrc @@ -1 +1 @@ -v20.3.0 +v20.10.0 diff --git a/package.json b/package.json index 807d2253b..3f9884a9e 100644 --- a/package.json +++ b/package.json @@ -85,7 +85,7 @@ "typescript": "^4.9.5" }, "engines": { - "node": ">=18" + "node": ">=20.10.0" }, "lint-staged": { "*.{ts,json}": [