From 2950f083e42563788640a68b5f2ccd0136399c8c Mon Sep 17 00:00:00 2001 From: lqS0317 <102649974+lqS0317@users.noreply.github.com> Date: Thu, 9 May 2024 12:56:32 +0800 Subject: [PATCH] add_workflow_auto_updates_snapshot (#82) * add_workflow_auto_updates_snapshot --------- Co-authored-by: lqS0317 --- .github/workflows/update_readme.yml | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 .github/workflows/update_readme.yml diff --git a/.github/workflows/update_readme.yml b/.github/workflows/update_readme.yml new file mode 100644 index 0000000..efd5961 --- /dev/null +++ b/.github/workflows/update_readme.yml @@ -0,0 +1,24 @@ +name: update readme +on: + schedule: + - cron: '0 5 * * *' +run-name: update readme +jobs: + update-readme: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + with: + token: ${{secrets.PAT}} + ref: main + - name: Update README + run: | + date=$(date +%Y%m%d) + current_time=$(grep -Eo '[0-9]{8}' run-node-mainnetv2.md |head -n1) + sed -i "s/${current_time}/$date/g" run-node-mainnetv2.md + git config --global user.email "git.action@mantle.xyz" + git config --global user.name "mantle-github-bot" + git add run-node-mainnetv2.md + git commit -m "update snapshot tar date" + git push https://mantle-github-bot:${{ secrets.PAT }}@github.com/mantlenetworkio/networks.git main \ No newline at end of file