mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-08-27 14:49:23 +00:00
Merge branch 'feature/react-overhaul' into feature/LicenseChecker
This commit is contained in:
commit
42da799703
35
.github/workflows/PR-Auto-Deploy-V2.yml
vendored
35
.github/workflows/PR-Auto-Deploy-V2.yml
vendored
@ -34,8 +34,9 @@ jobs:
|
|||||||
echo "PR Title: $PR_TITLE"
|
echo "PR Title: $PR_TITLE"
|
||||||
echo "PR Author: $PR_AUTHOR"
|
echo "PR Author: $PR_AUTHOR"
|
||||||
echo "PR Branch: $PR_BRANCH"
|
echo "PR Branch: $PR_BRANCH"
|
||||||
|
echo "PR Base Branch: ${{ github.event.pull_request.base.ref }}"
|
||||||
|
|
||||||
# Check if author is authorized
|
# Define authorized users
|
||||||
authorized_users=(
|
authorized_users=(
|
||||||
"Frooodle"
|
"Frooodle"
|
||||||
"sf298"
|
"sf298"
|
||||||
@ -47,6 +48,7 @@ jobs:
|
|||||||
"ConnorYoh"
|
"ConnorYoh"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
# Check if author is in the authorized list
|
||||||
is_authorized=false
|
is_authorized=false
|
||||||
for user in "${authorized_users[@]}"; do
|
for user in "${authorized_users[@]}"; do
|
||||||
if [[ "$PR_AUTHOR" == "$user" ]]; then
|
if [[ "$PR_AUTHOR" == "$user" ]]; then
|
||||||
@ -55,19 +57,26 @@ jobs:
|
|||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
# Check if title contains V2/version2 keywords (case insensitive)
|
# If PR is targeting feature/react-overhaul and user is authorized, deploy unconditionally
|
||||||
|
PR_BASE_BRANCH="${{ github.event.pull_request.base.ref }}"
|
||||||
|
if [[ "$PR_BASE_BRANCH" == "feature/react-overhaul" && "$is_authorized" == "true" ]]; then
|
||||||
|
echo "✅ Deployment forced: PR targets feature/react-overhaul and author is authorized."
|
||||||
|
echo "should_deploy=true" >> $GITHUB_OUTPUT
|
||||||
|
exit 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Otherwise, continue with original keyword checks
|
||||||
has_v2_keyword=false
|
has_v2_keyword=false
|
||||||
if [[ "$PR_TITLE" =~ [Vv]2 ]] || [[ "$PR_TITLE" =~ [Vv]ersion.?2 ]] || [[ "$PR_TITLE" =~ [Vv]ersion.?[Tt]wo ]]; then
|
if [[ "$PR_TITLE" =~ [Vv]2 ]] || [[ "$PR_TITLE" =~ [Vv]ersion.?2 ]] || [[ "$PR_TITLE" =~ [Vv]ersion.?[Tt]wo ]]; then
|
||||||
has_v2_keyword=true
|
has_v2_keyword=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Check if branch name contains V2 or react keywords (case insensitive)
|
|
||||||
has_branch_keyword=false
|
has_branch_keyword=false
|
||||||
if [[ "$PR_BRANCH" =~ [Vv]2 ]] || [[ "$PR_BRANCH" =~ [Rr]eact ]]; then
|
if [[ "$PR_BRANCH" =~ [Vv]2 ]] || [[ "$PR_BRANCH" =~ [Rr]eact ]]; then
|
||||||
has_branch_keyword=true
|
has_branch_keyword=true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ "$is_authorized" == "true" ]] && [[ "$has_v2_keyword" == "true" || "$has_branch_keyword" == "true" ]]; then
|
if [[ "$is_authorized" == "true" && ( "$has_v2_keyword" == "true" || "$has_branch_keyword" == "true" ) ]]; then
|
||||||
echo "✅ Deployment conditions met"
|
echo "✅ Deployment conditions met"
|
||||||
echo "should_deploy=true" >> $GITHUB_OUTPUT
|
echo "should_deploy=true" >> $GITHUB_OUTPUT
|
||||||
else
|
else
|
||||||
@ -111,9 +120,17 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
egress-policy: audit
|
egress-policy: audit
|
||||||
|
|
||||||
- name: Generate GitHub App Token
|
- name: Checkout main repository
|
||||||
id: generate-token
|
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||||
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
|
with:
|
||||||
|
repository: ${{ github.repository }}
|
||||||
|
ref: main
|
||||||
|
|
||||||
|
- name: Setup GitHub App Bot
|
||||||
|
if: github.actor != 'dependabot[bot]'
|
||||||
|
id: setup-bot
|
||||||
|
uses: ./.github/actions/setup-bot
|
||||||
|
continue-on-error: true
|
||||||
with:
|
with:
|
||||||
app-id: ${{ secrets.GH_APP_ID }}
|
app-id: ${{ secrets.GH_APP_ID }}
|
||||||
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
private-key: ${{ secrets.GH_APP_PRIVATE_KEY }}
|
||||||
@ -122,7 +139,7 @@ jobs:
|
|||||||
id: deployment-started
|
id: deployment-started
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
with:
|
with:
|
||||||
github-token: ${{ steps.generate-token.outputs.token }}
|
github-token: ${{ steps.setup-bot.outputs.token }}
|
||||||
script: |
|
script: |
|
||||||
const { owner, repo } = context.repo;
|
const { owner, repo } = context.repo;
|
||||||
const prNumber = ${{ needs.check-pr.outputs.pr_number }};
|
const prNumber = ${{ needs.check-pr.outputs.pr_number }};
|
||||||
@ -272,7 +289,7 @@ jobs:
|
|||||||
if: success()
|
if: success()
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
with:
|
with:
|
||||||
github-token: ${{ steps.generate-token.outputs.token }}
|
github-token: ${{ steps.setup-bot.outputs.token }}
|
||||||
script: |
|
script: |
|
||||||
const { owner, repo } = context.repo;
|
const { owner, repo } = context.repo;
|
||||||
const prNumber = ${{ needs.check-pr.outputs.pr_number }};
|
const prNumber = ${{ needs.check-pr.outputs.pr_number }};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user