mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-04-19 05:18:06 +00:00
Update update_json_date.yml
This commit is contained in:
parent
2c8aab24d0
commit
5c16955a8e
24
.github/workflows/update_json_date.yml
vendored
24
.github/workflows/update_json_date.yml
vendored
@ -3,12 +3,11 @@ name: Update JSON Date in PR
|
|||||||
on:
|
on:
|
||||||
pull_request:
|
pull_request:
|
||||||
paths:
|
paths:
|
||||||
- '.github/workflows/scripts/*.sh'
|
|
||||||
- 'json/*.json'
|
- 'json/*.json'
|
||||||
types: [opened, synchronize, reopened]
|
types: [opened, synchronize, reopened]
|
||||||
|
|
||||||
schedule:
|
schedule:
|
||||||
- cron: '0 */2 * * *'
|
- cron: '0 */2 * * *' # Alle 2 Stunden
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
update_json:
|
update_json:
|
||||||
@ -18,8 +17,29 @@ jobs:
|
|||||||
- name: Check out repository
|
- name: Check out repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Configure Git user
|
||||||
|
run: |
|
||||||
|
git config --global user.email "github-actions[bot]@users.noreply.github.com"
|
||||||
|
git config --global user.name "github-actions[bot]"
|
||||||
|
|
||||||
|
- name: Get the PR branch
|
||||||
|
run: |
|
||||||
|
echo "Fetching PR branch"
|
||||||
|
PR_BRANCH=$(jq --raw-output .pull_request.head.ref "$GITHUB_EVENT_PATH")
|
||||||
|
echo "PR Branch is $PR_BRANCH"
|
||||||
|
|
||||||
|
- name: Checkout PR branch
|
||||||
|
run: git checkout $PR_BRANCH
|
||||||
|
|
||||||
- name: Make script executable
|
- name: Make script executable
|
||||||
run: chmod +x .github/workflows/scripts/update_json_date.sh
|
run: chmod +x .github/workflows/scripts/update_json_date.sh
|
||||||
|
|
||||||
- name: Run the update script
|
- name: Run the update script
|
||||||
run: ./.github/workflows/scripts/update_json_date.sh
|
run: ./.github/workflows/scripts/update_json_date.sh
|
||||||
|
|
||||||
|
- name: Commit changes if updated
|
||||||
|
run: |
|
||||||
|
git add *.json
|
||||||
|
git diff --cached --quiet || git commit -m "Update JSON dates"
|
||||||
|
git push
|
||||||
|
continue-on-error: true
|
||||||
|
Loading…
x
Reference in New Issue
Block a user