From bb7ee174ea8961b89707b5236c3b549a8ea51008 Mon Sep 17 00:00:00 2001 From: Rock Chin <1010553892@qq.com> Date: Sun, 26 Mar 2023 23:34:50 +0800 Subject: [PATCH] Create update override-all.json --- .github/workflows/update override-all.json | 46 ++++++++++++++++++++++ 1 file changed, 46 insertions(+) create mode 100644 .github/workflows/update override-all.json diff --git a/.github/workflows/update override-all.json b/.github/workflows/update override-all.json new file mode 100644 index 00000000..79392dc7 --- /dev/null +++ b/.github/workflows/update override-all.json @@ -0,0 +1,46 @@ +name: Check for config-template.py changes and update override-all.json + +on: + push: + paths: + - 'config-template.py' + pull_request: + types: [closed] + paths: + - 'config-template.py' + branches: + - master + +jobs: + update-override-all: + if: github.event.pull_request.merged == true || github.event_name == 'push' + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v2 + with: + fetch-depth: 0 + + - name: Set up Python 3.9 + uses: actions/setup-python@v2 + with: + python-version: 3.9 + + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install -r requirements.txt + + - name: Run generate_override_all.py and check for changes + run: | + python3 generate_override_all.py + if git diff --exit-code override-all.json; then + echo "No changes to commit" + else + git config --global user.email "github-actions[bot]@users.noreply.github.com" + git config --global user.name "github-actions[bot]" + git add override-all.json + git commit -m "Update override-all.json based on config-template.py changes" + git push + fi