mirror of
https://github.com/Stirling-Tools/Stirling-PDF.git
synced 2025-06-22 15:35:03 +00:00
Update PR-Demo-Comment-with-react.yml
This commit is contained in:
parent
f82662aaaf
commit
3bc4fd079a
40
.github/workflows/PR-Demo-Comment-with-react.yml
vendored
40
.github/workflows/PR-Demo-Comment-with-react.yml
vendored
@ -38,7 +38,8 @@ jobs:
|
|||||||
pr_ref: ${{ steps.get-pr-info.outputs.ref }}
|
pr_ref: ${{ steps.get-pr-info.outputs.ref }}
|
||||||
comment_id: ${{ github.event.comment.id }}
|
comment_id: ${{ github.event.comment.id }}
|
||||||
disable_security: ${{ steps.check-security-flag.outputs.disable_security }}
|
disable_security: ${{ steps.check-security-flag.outputs.disable_security }}
|
||||||
|
enable_pro: ${{ steps.check-pro-flag.outputs.enable_pro }}
|
||||||
|
enable_enterprise: ${{ steps.check-pro-flag.outputs.enable_enterprise }}
|
||||||
steps:
|
steps:
|
||||||
- name: Harden Runner
|
- name: Harden Runner
|
||||||
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
uses: step-security/harden-runner@002fdce3c6a235733a90a27c80493a3241e56863 # v2.12.1
|
||||||
@ -98,6 +99,25 @@ jobs:
|
|||||||
echo "disable_security=true" >> $GITHUB_OUTPUT
|
echo "disable_security=true" >> $GITHUB_OUTPUT
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
- name: Check for pro flag
|
||||||
|
id: check-pro-flag
|
||||||
|
env:
|
||||||
|
COMMENT_BODY: ${{ github.event.comment.body }}
|
||||||
|
run: |
|
||||||
|
if [[ "$COMMENT_BODY" == *"pro"* ]] || [[ "$COMMENT_BODY" == *"premium"* ]]; then
|
||||||
|
echo "pro flags detected in comment"
|
||||||
|
echo "enable_pro=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "enable_enterprise=false" >> $GITHUB_OUTPUT
|
||||||
|
elif [[ "$COMMENT_BODY" == *"enterprise"* ]] || [[ "$COMMENT_BODY" == *"enterprise"* ]]; then
|
||||||
|
echo "enterprise flags detected in comment"
|
||||||
|
echo "enable_enterprise=true" >> $GITHUB_OUTPUT
|
||||||
|
echo "enable_pro=false" >> $GITHUB_OUTPUT
|
||||||
|
else
|
||||||
|
echo "No pro or enterprise flags detected in comment"
|
||||||
|
echo "enable_pro=false" >> $GITHUB_OUTPUT
|
||||||
|
echo "enable_enterprise=false" >> $GITHUB_OUTPUT
|
||||||
|
fi
|
||||||
|
|
||||||
- name: Add 'in_progress' reaction to comment
|
- name: Add 'in_progress' reaction to comment
|
||||||
id: add-eyes-reaction
|
id: add-eyes-reaction
|
||||||
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
|
||||||
@ -209,6 +229,21 @@ jobs:
|
|||||||
SECURITY_STATUS="Security Disabled"
|
SECURITY_STATUS="Security Disabled"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Set pro/enterprise settings (enterprise implies pro)
|
||||||
|
if [ "${{ needs.check-comment.outputs.enable_enterprise }}" == "true" ]; then
|
||||||
|
PREMIUM_ENABLED="true"
|
||||||
|
PREMIUM_KEY="${{ secrets.ENTERPRISE_KEY }}"
|
||||||
|
PREMIUM_PROFEATURES_AUDIT_ENABLED="true"
|
||||||
|
elif [ "${{ needs.check-comment.outputs.enable_pro }}" == "true" ]; then
|
||||||
|
PREMIUM_ENABLED="true"
|
||||||
|
PREMIUM_KEY="${{ secrets.PREMIUM_KEY }}"
|
||||||
|
PREMIUM_PROFEATURES_AUDIT_ENABLED="true"
|
||||||
|
else
|
||||||
|
PREMIUM_ENABLED="false"
|
||||||
|
PREMIUM_KEY=""
|
||||||
|
PREMIUM_PROFEATURES_AUDIT_ENABLED="false"
|
||||||
|
fi
|
||||||
|
|
||||||
# First create the docker-compose content locally
|
# First create the docker-compose content locally
|
||||||
cat > docker-compose.yml << EOF
|
cat > docker-compose.yml << EOF
|
||||||
version: '3.3'
|
version: '3.3'
|
||||||
@ -232,6 +267,9 @@ jobs:
|
|||||||
SYSTEM_MAXFILESIZE: "100"
|
SYSTEM_MAXFILESIZE: "100"
|
||||||
METRICS_ENABLED: "true"
|
METRICS_ENABLED: "true"
|
||||||
SYSTEM_GOOGLEVISIBILITY: "false"
|
SYSTEM_GOOGLEVISIBILITY: "false"
|
||||||
|
PREMIUM_KEY: "${PREMIUM_KEY}"
|
||||||
|
PREMIUM_ENABLED: "${PREMIUM_ENABLED}"
|
||||||
|
PREMIUM_PROFEATURES_AUDIT_ENABLED: "${PREMIUM_PROFEATURES_AUDIT_ENABLED}"
|
||||||
restart: on-failure:5
|
restart: on-failure:5
|
||||||
EOF
|
EOF
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user