Skip to content

[FX-5517] Add disableBackdrop to Drawer #1121

[FX-5517] Add disableBackdrop to Drawer

[FX-5517] Add disableBackdrop to Drawer #1121

name: Automatically merge non-major release PR
on:
pull_request:
branches:
- master
types:
- opened
env:
PR_NUMBER: ${{ github.event.number }}
PR_BODY: ${{ github.event.pull_request.body }}
jobs:
merge-release-pr:
if: ${{ github.event.pull_request.head.ref == 'changeset-release/master' }}
name: Merge release PR
runs-on: ubuntu-latest
permissions:
contents: write
id-token: write
actions: write
issues: write
pull-requests: write
timeout-minutes: 1
steps:
- name: GSM Secrets
id: secrets_manager
uses: toptal/davinci-github-actions/gsm-secrets@v15.0.0
with:
workload_identity_provider: ${{ secrets.IDENTITY_POOL }}
service_account: ${{ secrets.SA_IDENTITY_POOL }}
secrets_name: |-
TOPTAL_DEVBOT_TOKEN:toptal-ci/TOPTAL_DEVBOT_TOKEN
- name: Parse secrets
id: parse_secrets
uses: toptal/davinci-github-actions/expose-json-outputs@v15.0.0
with:
json: ${{ steps.secrets_manager.outputs.secrets }}
- name: Set ENV Variables
run: |-
echo "DEVBOT_TOKEN=${{ steps.parse_secrets.outputs.TOPTAL_DEVBOT_TOKEN }}" >> $GITHUB_ENV
- name: Merge pull request if the release is not major
uses: actions/github-script@v7
with:
github-token: ${{ env.DEVBOT_TOKEN }}
script: |
const { PR_NUMBER, PR_BODY } = process.env
const repository = context.repo
const isMajorRelease = PR_BODY.includes("### Major Changes")
const commentBody = isMajorRelease ?
"This pull request seems to be a **major** release and will **not** be merged automatically"
: "This pull request seems to be a **non-major** release and will be merged automatically"
await github.rest.issues.createComment({
owner: repository.owner,
issue_number: PR_NUMBER,
repo: repository.repo,
body: commentBody,
})
if (!isMajorRelease) {
await github.rest.pulls.merge({
merge_method: "squash",
owner: repository.owner,
pull_number: PR_NUMBER,
repo: repository.repo,
})
}