mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2025-05-15 16:20:25 +00:00
Add App to do the merging (#4461)
This commit is contained in:
parent
4a1f87727b
commit
d703a8abb2
15
.github/workflows/auto-update-app-headers.yml
vendored
15
.github/workflows/auto-update-app-headers.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'ct/**.sh'
|
- "ct/**.sh"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -25,6 +25,13 @@ jobs:
|
|||||||
app-id: ${{ vars.APP_ID }}
|
app-id: ${{ vars.APP_ID }}
|
||||||
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Generate a token for PR approval and merge
|
||||||
|
id: generate-token-merge
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.APP_ID_APPROVE_AND_MERGE }}
|
||||||
|
private-key: ${{ secrets.APP_KEY_APPROVE_AND_MERGE }}
|
||||||
|
|
||||||
# Step 1: Checkout repository
|
# Step 1: Checkout repository
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v2
|
uses: actions/checkout@v2
|
||||||
@ -94,9 +101,11 @@ jobs:
|
|||||||
- name: Approve pull request and merge
|
- name: Approve pull request and merge
|
||||||
if: env.changed == 'true'
|
if: env.changed == 'true'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.PAT_AUTOMERGE }}
|
GH_TOKEN: ${{ steps.generate-token-merge.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
PR_NUMBER=$(gh pr list --head "pr-update-app-files" --json number --jq '.[].number')
|
git config --global user.name "github-actions-automege[bot]"
|
||||||
|
git config --global user.email "github-actions-automege[bot]@users.noreply.github.com"
|
||||||
|
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
|
||||||
if [ -n "$PR_NUMBER" ]; then
|
if [ -n "$PR_NUMBER" ]; then
|
||||||
gh pr review $PR_NUMBER --approve
|
gh pr review $PR_NUMBER --approve
|
||||||
gh pr merge $PR_NUMBER --squash --admin
|
gh pr merge $PR_NUMBER --squash --admin
|
||||||
|
21
.github/workflows/changelog-pr.yml
vendored
21
.github/workflows/changelog-pr.yml
vendored
@ -24,6 +24,13 @@ jobs:
|
|||||||
app-id: ${{ vars.APP_ID }}
|
app-id: ${{ vars.APP_ID }}
|
||||||
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Generate a token for PR approval and merge
|
||||||
|
id: generate-token-merge
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.APP_ID_APPROVE_AND_MERGE }}
|
||||||
|
private-key: ${{ secrets.APP_KEY_APPROVE_AND_MERGE }}
|
||||||
|
|
||||||
- name: Checkout code
|
- name: Checkout code
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
@ -267,20 +274,12 @@ jobs:
|
|||||||
- name: Approve pull request and merge
|
- name: Approve pull request and merge
|
||||||
if: env.changed == 'true'
|
if: env.changed == 'true'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.PAT_AUTOMERGE }}
|
GH_TOKEN: ${{ steps.generate-token-merge.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
|
git config --global user.name "github-actions-automege[bot]"
|
||||||
|
git config --global user.email "github-actions-automege[bot]@users.noreply.github.com"
|
||||||
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
|
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
|
||||||
if [ -n "$PR_NUMBER" ]; then
|
if [ -n "$PR_NUMBER" ]; then
|
||||||
gh pr review $PR_NUMBER --approve
|
gh pr review $PR_NUMBER --approve
|
||||||
gh pr merge $PR_NUMBER --squash --admin
|
gh pr merge $PR_NUMBER --squash --admin
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Re-approve pull request after update
|
|
||||||
if: env.changed == 'true'
|
|
||||||
env:
|
|
||||||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
|
||||||
run: |
|
|
||||||
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
|
|
||||||
if [ -n "$PR_NUMBER" ]; then
|
|
||||||
gh pr review $PR_NUMBER --approve
|
|
||||||
fi
|
|
||||||
|
16
.github/workflows/update-json-date.yml
vendored
16
.github/workflows/update-json-date.yml
vendored
@ -5,7 +5,7 @@ on:
|
|||||||
branches:
|
branches:
|
||||||
- main
|
- main
|
||||||
paths:
|
paths:
|
||||||
- 'frontend/public/json/**.json'
|
- "frontend/public/json/**.json"
|
||||||
workflow_dispatch:
|
workflow_dispatch:
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
@ -25,6 +25,13 @@ jobs:
|
|||||||
app-id: ${{ vars.APP_ID }}
|
app-id: ${{ vars.APP_ID }}
|
||||||
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.APP_PRIVATE_KEY }}
|
||||||
|
|
||||||
|
- name: Generate a token for PR approval and merge
|
||||||
|
id: generate-token-merge
|
||||||
|
uses: actions/create-github-app-token@v1
|
||||||
|
with:
|
||||||
|
app-id: ${{ secrets.APP_ID_APPROVE_AND_MERGE }}
|
||||||
|
private-key: ${{ secrets.APP_KEY_APPROVE_AND_MERGE }}
|
||||||
|
|
||||||
- name: Generate dynamic branch name
|
- name: Generate dynamic branch name
|
||||||
id: timestamp
|
id: timestamp
|
||||||
run: echo "BRANCH_NAME=pr-update-json-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
|
run: echo "BRANCH_NAME=pr-update-json-$(date +'%Y%m%d%H%M%S')" >> $GITHUB_ENV
|
||||||
@ -126,12 +133,15 @@ jobs:
|
|||||||
if [ -n "$PR_NUMBER" ]; then
|
if [ -n "$PR_NUMBER" ]; then
|
||||||
gh pr review $PR_NUMBER --approve
|
gh pr review $PR_NUMBER --approve
|
||||||
fi
|
fi
|
||||||
|
|
||||||
- name: Approve pull request and merge
|
- name: Approve pull request and merge
|
||||||
if: env.changed == 'true'
|
if: env.changed == 'true'
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ secrets.PAT_AUTOMERGE }}
|
GH_TOKEN: ${{ steps.generate-token-merge.outputs.token }}
|
||||||
run: |
|
run: |
|
||||||
PR_NUMBER=$(gh pr list --head "${{ env.BRANCH_NAME }}" --json number --jq '.[].number')
|
git config --global user.name "github-actions-automege[bot]"
|
||||||
|
git config --global user.email "github-actions-automege[bot]@users.noreply.github.com"
|
||||||
|
PR_NUMBER=$(gh pr list --head "${BRANCH_NAME}" --json number --jq '.[].number')
|
||||||
if [ -n "$PR_NUMBER" ]; then
|
if [ -n "$PR_NUMBER" ]; then
|
||||||
gh pr review $PR_NUMBER --approve
|
gh pr review $PR_NUMBER --approve
|
||||||
gh pr merge $PR_NUMBER --squash --admin
|
gh pr merge $PR_NUMBER --squash --admin
|
||||||
|
Loading…
x
Reference in New Issue
Block a user