Update update override-all.json

This commit is contained in:
Rock Chin
2023-03-26 23:38:38 +08:00
committed by GitHub
parent 348477747e
commit b4edd5cbad
+23 -21
View File
@@ -1,46 +1,48 @@
name: Check for config-template.py changes and update override-all.json name: Check and Update override-all.json
on: on:
push: push:
paths: paths:
- 'config-template.py' - 'config-template.py'
pull_request: pull_request:
types: [closed] types:
- closed
branches:
- main
paths: paths:
- 'config-template.py' - 'config-template.py'
branches:
- master
jobs: jobs:
update-override-all: update-override-all:
if: github.event.pull_request.merged == true || github.event_name == 'push' if: github.event.pull_request.merged == true || github.event_name == 'push'
runs-on: ubuntu-latest runs-on: ubuntu-latest
steps: steps:
- name: Checkout repository - name: Checkout repository
uses: actions/checkout@v2 uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Set up Python 3.9 - name: Set up Python
uses: actions/setup-python@v2 uses: actions/setup-python@v2
with: with:
python-version: 3.9 python-version: 3.x
- name: Install dependencies - name: Install dependencies
run: | run: |
python -m pip install --upgrade pip python -m pip install --upgrade pip
pip install -r requirements.txt #
- name: Run generate_override_all.py and check for changes - name: Run generate_override_all.py
run: python3 generate_override_all.py
- name: Check for changes in override-all.json
id: check_changes
run: | run: |
python3 generate_override_all.py git diff --exit-code override-all.json || echo "::set-output name=changes_detected::true"
if git diff --exit-code override-all.json; then
echo "No changes to commit" - name: Commit and push changes
else if: steps.check_changes.outputs.changes_detected == 'true'
git config --global user.email "github-actions[bot]@users.noreply.github.com" run: |
git config --global user.name "github-actions[bot]" git config --global user.email "github-actions[bot]@users.noreply.github.com"
git add override-all.json git config --global user.name "GitHub Actions"
git commit -m "Update override-all.json based on config-template.py changes" git add override-all.json
git push git commit -m "Update override-all.json"
fi git push