Skip to content

trim & sanitize keys for fm, page, cart, link #717

trim & sanitize keys for fm, page, cart, link

trim & sanitize keys for fm, page, cart, link #717

Workflow file for this run

# neon ref: https://neon.tech/blog/branching-with-preview-environments
name: Preview
on:
pull_request:
merge_group:
types: [checks_requested]
jobs:
# 👾 GIT METADATA #
git-meta:
runs-on: ubuntu-latest
if: always() && github.event_name == 'pull_request'
outputs:
git_branch_name: ${{ steps.git-meta.outputs.github_commit_ref }}
github_commit_sha: ${{ steps.git-meta.outputs.github_commit_sha }}
github_commit_author_name: ${{ steps.git-meta.outputs.github_commit_author_name }}
github_commit_author_login: ${{ steps.git-meta.outputs.github_commit_author_login }}
github_deployment: ${{ steps.git-meta.outputs.github_deployment }}
github_org: ${{ steps.git-meta.outputs.github_org }}
github_repo: ${{ steps.git-meta.outputs.github_repo }}
github_commit_org: ${{ steps.git-meta.outputs.github_commit_org }}
github_commit_repo: ${{ steps.git-meta.outputs.github_commit_repo }}
github_commit_message: ${{ steps.git-meta.outputs.github_commit_message }}
github_commit_ref: ${{ steps.git-meta.outputs.github_commit_ref }}
vercel_git_metadata: ${{ steps.git-meta.outputs.vercel_git_metadata }}
steps:
- name: checkout
uses: actions/checkout@v4
with:
fetch-depth: 2
- id: git-meta
run: |
github_commit_sha=${{ github.event.pull_request.head.sha }}
github_commit_author_login=${{ github.actor }}
github_deployment=1
github_org=${{ github.repository_owner }}
github_repo=${{ github.repository }}
github_commit_org=${{ github.repository_owner }}
github_commit_repo=${{ github.repository }}
github_commit_message=$(git show -s --format=%s $github_commit_sha)
github_commit_ref=${{ github.event.pull_request.head.ref }}
vercel_git_metadata="-m githubCommitSha=$github_commit_sha -m githubCommitAuthorName=$github_commit_author_login -m githubCommitAuthorLogin=$github_commit_author_login -m githubDeployment=$github_deployment -m githubOrg=$github_org -m githubRepo=$github_repo -m githubCommitOrg=$github_commit_org -m githubCommitRepo=$github_commit_repo -m githubCommitMessage=\"$github_commit_message\" -m githubCommitRef=$github_commit_ref"
echo "github_commit_sha=$github_commit_sha" >> $GITHUB_OUTPUT
echo "github_commit_author_name=$github_commit_author_name" >> $GITHUB_OUTPUT
echo "github_commit_author_login=$github_commit_author_login" >> $GITHUB_OUTPUT
echo "github_deployment=$github_deployment" >> $GITHUB_OUTPUT
echo "github_org=$github_org" >> $GITHUB_OUTPUT
echo "github_repo=$github_repo" >> $GITHUB_OUTPUT
echo "github_commit_org=$github_commit_org" >> $GITHUB_OUTPUT
echo "github_commit_repo=$github_commit_repo" >> $GITHUB_OUTPUT
echo "github_commit_message=$github_commit_message" >> $GITHUB_OUTPUT
echo "github_commit_ref=$github_commit_ref" >> $GITHUB_OUTPUT
echo "vercel_git_metadata=$vercel_git_metadata" >> $GITHUB_OUTPUT
# 🐘 NEON DB PREVIEW #
neon-preview:
name: neon preview
if: always() && github.event_name == 'pull_request'
needs: [git-meta]
permissions: write-all
runs-on: ubuntu-latest
env:
VERCEL_ACCESS_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_APP_PROJECT_ID }}
VERCEL_ORG_ID: ${{ secrets.VERCEL_TEAM_ID }}
steps:
- name: checkout
uses: actions/checkout@v4
- name: setup node/pnpm/turbo/vercel
uses: ./tooling/github/setup
- name: install neon cli
run: pnpm i -g neonctl
# This is just so the env check doesn't fail on missing variables.
# DATABASE_URL && DATABASE_POOL_URL will be overwritten below.
- name: copy env
shell: bash
run: cp .env.example .env
# If the branch already exists, this command will fail but the workflow will continue
- id: create-branch
run: |
output=$(neonctl branches create --project-id ${{ secrets.NEON_PROJECT_ID }} --name ${{ needs.git-meta.outputs.git_branch_name }} --api-key ${{ secrets.NEON_API_KEY }} --compute --type read_write 2>&1) || true
if [[ $output == *"branch with the provided name \"${{ needs.git-meta.outputs.git_branch_name }}\" already exists"* ]]; then
echo "A branch named \"${{ needs.git-meta.outputs.git_branch_name }}\" already exists. Using that branch for this preview deployment."
elif [[ $output == *"error:"* || $output == *"severity: 'ERROR'"* ]]; then
echo "Unhandled error: $output" && exit 1
fi
# The branch ID is needed to display the URL of the branch in the comment.
- id: get-neon-branch
run: |
branch_id=$(neonctl branches get ${{ needs.git-meta.outputs.git_branch_name }} --project-id ${{ secrets.NEON_PROJECT_ID }} --api-key ${{ secrets.NEON_API_KEY }} --output json | jq -r '.id')
echo "branch_id=$branch_id" >> $GITHUB_ENV
DATABASE_URL=$(neonctl connection-string ${{ needs.git-meta.outputs.git_branch_name }} --project-id ${{ secrets.NEON_PROJECT_ID }} --role-name ${{ secrets.PG_USERNAME }} --database-name ${{ secrets.PG_DATABASE }} --api-key ${{ secrets.NEON_API_KEY }} | tr -d '\n')?sslmode=require
echo "DATABASE_URL=$DATABASE_URL" >> $GITHUB_ENV
DATABASE_POOL_URL=$(neonctl connection-string ${{ needs.git-meta.outputs.git_branch_name }} --pooled --project-id ${{ secrets.NEON_PROJECT_ID }} --role-name ${{ secrets.PG_USERNAME }} --database-name ${{ secrets.PG_DATABASE }} --api-key ${{ secrets.NEON_API_KEY }} | tr -d '\n')?sslmode=require
echo "DATABASE_POOL_URL=$DATABASE_POOL_URL" >> $GITHUB_ENV
- name: db:push
run: |
rm -f .env
touch .env
echo "DATABASE_URL: $DATABASE_URL"
echo "DATABASE_POOL_URL: $DATABASE_POOL_URL"
echo "DATABASE_URL=$DATABASE_URL" >> .env
echo "DATABASE_POOL_URL=$DATABASE_POOL_URL" >> .env
output=$(pnpm db:push)
echo "output: $output"
if [[ $output == *"error:"* || $output == *"severity: 'ERROR'"* ]]; then
echo "Unhandled error: $output" && exit 1
fi
# Using Vercel as our secret store for the DATABASE_URL and DATABASE_POOL_URL
# -- to my knowledge, using an external store is the only way to pass secrets between Github Actions jobs?
- name: update vercel env - app/preview/branch
run: |
echo "DATABASE_URL: $DATABASE_URL"
echo "DATABASE_POOL_URL: $DATABASE_POOL_URL"
branch_name=${{ needs.git-meta.outputs.git_branch_name }}
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_URL; then
echo "Removing existing DATABASE_URL env variable from preview branch (git branch: $branch_name)"
pnpm vercel env rm DATABASE_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_POOL_URL; then
echo "Removing existing DATABASE_POOL_URL env variable from preview branch (git branch: $branch_name)"
pnpm vercel env rm DATABASE_POOL_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
echo $DATABASE_URL | pnpm vercel env add DATABASE_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
echo $DATABASE_POOL_URL | pnpm vercel env add DATABASE_POOL_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
- name: update vercel env - cart/preview/branch
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_CART_PROJECT_ID }}
run: |
branch_name=${{ needs.git-meta.outputs.git_branch_name }}
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_URL; then
pnpm vercel env rm DATABASE_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_POOL_URL; then
pnpm vercel env rm DATABASE_POOL_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
echo $DATABASE_URL | pnpm vercel env add DATABASE_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
echo $DATABASE_POOL_URL | pnpm vercel env add DATABASE_POOL_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
- name: update vercel env - fm/preview/branch
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_FM_PROJECT_ID }}
run: |
branch_name=${{ needs.git-meta.outputs.git_branch_name }}
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_URL; then
pnpm vercel env rm DATABASE_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_POOL_URL; then
pnpm vercel env rm DATABASE_POOL_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
echo $DATABASE_URL | pnpm vercel env add DATABASE_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
echo $DATABASE_POOL_URL | pnpm vercel env add DATABASE_POOL_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
- name: update vercel env - link/preview/branch
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_LINK_PROJECT_ID }}
run: |
branch_name=${{ needs.git-meta.outputs.git_branch_name }}
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_URL; then
pnpm vercel env rm DATABASE_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_POOL_URL; then
pnpm vercel env rm DATABASE_POOL_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
echo $DATABASE_URL | pnpm vercel env add DATABASE_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
echo $DATABASE_POOL_URL | pnpm vercel env add DATABASE_POOL_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
- name: update vercel env - manage-email/preview/branch
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_MANAGE_EMAIL_PROJECT_ID }}
run: |
branch_name=${{ needs.git-meta.outputs.git_branch_name }}
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_URL; then
pnpm vercel env rm DATABASE_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_POOL_URL; then
pnpm vercel env rm DATABASE_POOL_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
echo $DATABASE_URL | pnpm vercel env add DATABASE_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
echo $DATABASE_POOL_URL | pnpm vercel env add DATABASE_POOL_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
- name: update vercel env - page/preview/branch
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PAGE_PROJECT_ID }}
run: |
branch_name=${{ needs.git-meta.outputs.git_branch_name }}
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_URL; then
pnpm vercel env rm DATABASE_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_POOL_URL; then
pnpm vercel env rm DATABASE_POOL_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
echo $DATABASE_URL | pnpm vercel env add DATABASE_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
echo $DATABASE_POOL_URL | pnpm vercel env add DATABASE_POOL_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
- name: update vercel env - press/preview/branch
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PRESS_PROJECT_ID }}
run: |
branch_name=${{ needs.git-meta.outputs.git_branch_name }}
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_URL; then
pnpm vercel env rm DATABASE_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_POOL_URL; then
pnpm vercel env rm DATABASE_POOL_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
echo $DATABASE_URL | pnpm vercel env add DATABASE_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
echo $DATABASE_POOL_URL | pnpm vercel env add DATABASE_POOL_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
- name: update vercel env - www/preview/branch
env:
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_WWW_PROJECT_ID }}
run: |
branch_name=${{ needs.git-meta.outputs.git_branch_name }}
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_URL; then
pnpm vercel env rm DATABASE_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
if pnpm vercel env ls preview $branch_name --token=${{ secrets.VERCEL_TOKEN }} | grep -q DATABASE_POOL_URL; then
pnpm vercel env rm DATABASE_POOL_URL preview $branch_name --yes --token=${{ secrets.VERCEL_TOKEN }}
fi
echo $DATABASE_URL | pnpm vercel env add DATABASE_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
echo $DATABASE_POOL_URL | pnpm vercel env add DATABASE_POOL_URL preview $branch_name --token=${{ secrets.VERCEL_TOKEN }}
outputs:
neon_branch_id: ${{ steps.get-neon-branch.outputs.branch_id }}
trigger-preview:
name: trigger staging
if: always() && github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: setup node/pnpm/turbo/vercel
uses: ./tooling/github/setup
- name: deploy trigger.dev
env:
TRIGGER_ACCESS_TOKEN: ${{ secrets.TRIGGER_ACCESS_TOKEN }}
run: pnpm deploy-trigger:staging
# 👀 DEPLOY PREVIEWS
deploy-app:
uses: ./.github/workflows/deploy-to-vercel.yml
needs: [neon-preview, git-meta]
with:
app_name: app
working_directory: apps/app
scope: barely
environment: preview
git_branch: ${{ needs.git-meta.outputs.git_branch_name }}
vercel_git_metadata: ${{ needs.git-meta.outputs.vercel_git_metadata }}
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_APP_PROJECT_ID }}
deploy-cart:
uses: ./.github/workflows/deploy-to-vercel.yml
needs: [neon-preview, git-meta]
with:
app_name: cart
working_directory: apps/cart
scope: barely
environment: preview
git_branch: ${{ needs.git-meta.outputs.git_branch_name }}
vercel_git_metadata: ${{ needs.git-meta.outputs.vercel_git_metadata }}
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_CART_PROJECT_ID }}
deploy-link:
uses: ./.github/workflows/deploy-to-vercel.yml
needs: [neon-preview, git-meta]
with:
app_name: link
working_directory: apps/link
scope: barely
environment: preview
git_branch: ${{ needs.git-meta.outputs.git_branch_name }}
vercel_git_metadata: ${{ needs.git-meta.outputs.vercel_git_metadata }}
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_LINK_PROJECT_ID }}
deploy-fm:
uses: ./.github/workflows/deploy-to-vercel.yml
needs: [neon-preview, git-meta]
with:
app_name: fm
working_directory: apps/fm
scope: barely
environment: preview
git_branch: ${{ needs.git-meta.outputs.git_branch_name }}
vercel_git_metadata: ${{ needs.git-meta.outputs.vercel_git_metadata }}
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_FM_PROJECT_ID }}
deploy-manage-email:
uses: ./.github/workflows/deploy-to-vercel.yml
needs: [neon-preview, git-meta]
with:
app_name: manage-email
working_directory: apps/manage-email
scope: barely
environment: preview
git_branch: ${{ needs.git-meta.outputs.git_branch_name }}
vercel_git_metadata: ${{ needs.git-meta.outputs.vercel_git_metadata }}
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_MANAGE_EMAIL_PROJECT_ID }}
deploy-page:
uses: ./.github/workflows/deploy-to-vercel.yml
needs: [neon-preview, git-meta]
with:
app_name: page
working_directory: apps/page
scope: barely
environment: preview
git_branch: ${{ needs.git-meta.outputs.git_branch_name }}
vercel_git_metadata: ${{ needs.git-meta.outputs.vercel_git_metadata }}
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PAGE_PROJECT_ID }}
deploy-press:
uses: ./.github/workflows/deploy-to-vercel.yml
needs: [neon-preview, git-meta]
with:
app_name: press
working_directory: apps/press
scope: barely
environment: preview
git_branch: ${{ needs.git-meta.outputs.git_branch_name }}
vercel_git_metadata: ${{ needs.git-meta.outputs.vercel_git_metadata }}
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PRESS_PROJECT_ID }}
deploy-sparrow:
uses: ./.github/workflows/deploy-to-vercel.yml
needs: [neon-preview, git-meta]
with:
app_name: sparrow
working_directory: apps/sparrow
scope: barely
environment: preview
git_branch: ${{ needs.git-meta.outputs.git_branch_name }}
vercel_git_metadata: ${{ needs.git-meta.outputs.vercel_git_metadata }}
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_SPARROW_PROJECT_ID }}
deploy-www:
uses: ./.github/workflows/deploy-to-vercel.yml
needs: [neon-preview, git-meta]
with:
app_name: www
working_directory: apps/www
scope: barely
environment: preview
git_branch: ${{ needs.git-meta.outputs.git_branch_name }}
vercel_git_metadata: ${{ needs.git-meta.outputs.vercel_git_metadata }}
secrets:
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
VERCEL_TEAM_ID: ${{ secrets.VERCEL_TEAM_ID }}
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_WWW_PROJECT_ID }}
# 💬 COMMENT ON PR #
comment:
if: always() && github.event_name == 'pull_request'
needs:
[
neon-preview,
deploy-app,
deploy-cart,
deploy-link,
deploy-fm,
deploy-page,
deploy-press,
deploy-sparrow,
deploy-www,
]
runs-on: ubuntu-latest
steps:
- name: checkout
uses: actions/checkout@v4
- name: comment on pull request
uses: thollander/actions-comment-pull-request@v2
with:
message: |
## apps
| :iphone: app | :rocket: preview | :mag: inspect |
| ------------ | ---------------- | ------------- |
| :iphone: app | [preview](${{ needs.deploy-app.outputs.deployment_url }}) | [inspect](${{ needs.deploy-app.outputs.inspect_url }}) |
| :shopping_cart: cart | [preview](${{ needs.deploy-cart.outputs.deployment_url }}) | [inspect](${{ needs.deploy-cart.outputs.inspect_url }}) |
| :link: link | [preview](${{ needs.deploy-link.outputs.deployment_url }}) | [inspect](${{ needs.deploy-link.outputs.inspect_url }}) |
| :radio: fm | [preview](${{ needs.deploy-fm.outputs.deployment_url }}) | [inspect](${{ needs.deploy-fm.outputs.inspect_url }}) |
| :newspaper: press | [preview](${{ needs.deploy-press.outputs.deployment_url }}) | [inspect](${{ needs.deploy-press.outputs.inspect_url }}) |
| :bird: sparrow | [preview](${{ needs.deploy-sparrow.outputs.deployment_url }}) | [inspect](${{ needs.deploy-sparrow.outputs.inspect_url }}) |
| :globe_with_meridians: www | [preview](${{ needs.deploy-www.outputs.deployment_url }}) | [inspect](${{ needs.deploy-www.outputs.inspect_url }}) |
| :page_facing_up: page | [preview](${{ needs.deploy-page.outputs.deployment_url }}) | [inspect](${{ needs.deploy-page.outputs.inspect_url }}) |
## db
| :floppy_disk: db | :mag: inspect |
| ---------------- | ------------- |
| :elephant: neon | [inspect](${{ needs.neon-preview.outputs.neon_branch_id }}) |
preview--can-merge:
needs:
[
neon-preview,
trigger-preview,
deploy-app,
deploy-cart,
deploy-fm,
deploy-link,
deploy-manage-email,
deploy-page,
deploy-press,
deploy-sparrow,
deploy-www,
]
if: always() && github.event_name == 'pull_request'
runs-on: ubuntu-latest
permissions:
actions: read
steps:
- name: Transform outcomes
env:
NEEDS_JSON: '${{ toJson(needs) }}'
run: |
echo "ALL_SUCCESS=$(echo "$NEEDS_JSON" | jq '. | to_entries | map([.value.result == "success", .value.result == "skipped"] | any) | all')" >> $GITHUB_ENV
- name: Check outcomes
run: '[ $ALL_SUCCESS = true ]'