-
Notifications
You must be signed in to change notification settings - Fork 429
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Configure Optimism and Base fast sync settings update (#7448)
- Loading branch information
Showing
3 changed files
with
85 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,8 +1,8 @@ | ||
name: "[UPDATE] Config files (fast sync settings)" | ||
name: Update fast sync settings | ||
|
||
on: | ||
schedule: | ||
- cron: "0 0 * * 0" | ||
- cron: '0 0 * * 0' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
|
@@ -11,58 +11,33 @@ permissions: | |
|
||
jobs: | ||
update-configs: | ||
if: github.repository_owner == 'NethermindEth' | ||
name: Update fast sync settings in config files | ||
name: Update fast sync settings | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v3 | ||
with: | ||
ref: ${{ github.ref }} | ||
- name: Authenticate App | ||
id: gh-app | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.APP_ID }} | ||
private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
pip3 install setuptools | ||
pip3 install emoji | ||
- name: Update config files | ||
run: | | ||
python3 scripts/syncSettings.py ${{ secrets.ETHERSCAN_API_KEY }} | ||
- name: Create pull request | ||
uses: peter-evans/create-[email protected] | ||
run: python3 scripts/syncSettings.py ${{ secrets.ETHERSCAN_API_KEY }} | ||
- name: Create GitHub app token | ||
id: gh-app | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
token: ${{ steps.gh-app.outputs.token }} | ||
commit-message: Updating Fast Sync config files | ||
body: | | ||
Config files included: | ||
- mainnet.cfg | ||
- gnosis.cfg | ||
- chiado.cfg | ||
- sepolia.cfg | ||
- energyweb.cfg | ||
- volta.cfg | ||
- exosama.cfg | ||
- joc-mainnet.cfg | ||
- joc-testnet.cfg | ||
Properties refreshed: | ||
- PivotNumber | ||
- PivotHash | ||
- PivotTotalDifficulty | ||
- Auto-generated by [create-pull-request][1] | ||
[1]: https://github.com/peter-evans/create-pull-request | ||
title: "Update Fast Sync configuration in Nethermind repository" | ||
labels: configs | ||
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com> | ||
committer: GitHub <[email protected]> | ||
branch: configs-update | ||
branch-suffix: short-commit-hash | ||
base: master | ||
- name: Check outputs | ||
app-id: ${{ vars.APP_ID }} | ||
private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
- name: Create a pull request | ||
env: | ||
GH_TOKEN: ${{ steps.gh-app.outputs.token }} | ||
run: | | ||
echo "Pull Request Number - ${{ env.PULL_REQUEST_NUMBER }}" | ||
head_branch=feature/fast-sync-config-${{ github.run_number }}-${{ github.run_attempt }} | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
git checkout -b $head_branch | ||
git add -A | ||
git commit -am "Auto-update fast sync settings" | ||
git push origin $head_branch | ||
gh pr create -B master -H $head_branch -t "Auto-update fast sync settings" \ | ||
-b "Updated fast sync settings in the configuration files" -l configuration -l sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
name: Update fast sync settings | ||
|
||
on: | ||
schedule: | ||
- cron: '0 0 * * 0' | ||
workflow_dispatch: | ||
|
||
permissions: | ||
contents: write | ||
pull-requests: write | ||
|
||
jobs: | ||
update-configs: | ||
name: Update fast sync settings | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check out repository | ||
uses: actions/checkout@v4 | ||
- name: Install dependencies | ||
run: | | ||
pip3 install setuptools | ||
pip3 install emoji | ||
- name: Update config files | ||
run: python3 scripts/syncSettings.py ${{ secrets.ETHERSCAN_API_KEY }} | ||
- name: Create GitHub app token | ||
id: gh-app | ||
uses: actions/create-github-app-token@v1 | ||
with: | ||
app-id: ${{ vars.APP_ID }} | ||
private-key: ${{ secrets.APP_PRIVATE_KEY }} | ||
- name: Create a pull request | ||
env: | ||
GH_TOKEN: ${{ steps.gh-app.outputs.token }} | ||
run: | | ||
head_branch=feature/fast-sync-config-${{ github.run_number }}-${{ github.run_attempt }} | ||
git config user.name "${{ github.actor }}" | ||
git config user.email "${{ github.actor }}@users.noreply.github.com" | ||
git checkout -b $head_branch | ||
git add -A | ||
git commit -am "Auto-update fast sync settings" | ||
git push origin $head_branch | ||
gh pr create -B master -H $head_branch -t "Auto-update fast sync settings" \ | ||
-b "Updated fast sync settings in config files" -l configuration -l sync |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters