mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-09-16 04:09:48 +00:00
[gh] Workflow to change date on new json files (#2319)
This commit is contained in:
parent
2692cbe5e0
commit
24a2bbdb65
2 changed files with 159 additions and 0 deletions
28
.github/workflows/delete-json-branch.yml
vendored
Normal file
28
.github/workflows/delete-json-branch.yml
vendored
Normal file
|
@ -0,0 +1,28 @@
|
|||
|
||||
name: Delete JSON date PR Branch
|
||||
|
||||
on:
|
||||
pull_request:
|
||||
types: [closed]
|
||||
branches:
|
||||
- main
|
||||
|
||||
jobs:
|
||||
delete_branch:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Checkout the code
|
||||
uses: actions/checkout@v3
|
||||
|
||||
- name: Delete PR Update Branch
|
||||
if: github.event.pull_request.merged == true && startsWith(github.event.pull_request.head.ref, 'pr-update-json-')
|
||||
run: |
|
||||
PR_BRANCH="${{ github.event.pull_request.head.ref }}"
|
||||
echo "Deleting branch $PR_BRANCH..."
|
||||
|
||||
# Avoid deleting the default branch (e.g., main)
|
||||
if [[ "$PR_BRANCH" != "main" ]]; then
|
||||
git push origin --delete "$PR_BRANCH"
|
||||
else
|
||||
echo "Skipping deletion of the main branch"
|
||||
fi
|
Loading…
Add table
Add a link
Reference in a new issue