Skip to content

Convert login form username to lowercase (DEV-1165) #618

Convert login form username to lowercase (DEV-1165)

Convert login form username to lowercase (DEV-1165) #618

name: 🧹 EAS Update Branch Cleanup
on:
pull_request:
types: [closed]
jobs:
prepare:
runs-on: ubuntu-latest
permissions:
actions: read # Required to find the last successful workflow run
contents: read # Required for actions/checkout
steps:
- name: πŸ— Check out repo
uses: actions/checkout@v4
with:
fetch-depth: 0 # Checks out all branches and tags. Maybe we can make this better in the future?
# This line is needed for nx affected to work when CI is running on a PR
- name: πŸ”€ Track main if PR
if: github.ref != 'refs/heads/main'
run: git branch --track main origin/main
- name: πŸ”§ Configure NX SHAs
uses: nrwl/nx-set-shas@v4
- name: πŸ”§ Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.12.2
- run: |
corepack enable
- name: Setup Yarn in Node
uses: actions/setup-node@v4
with:
cache: 'yarn'
- name: πŸ“¦ Install dependencies
run: yarn install
- name: 🧩 Determine Affected Projects for eas-update
id: set-matrix
run: |
# Get the list of affected projects with eas-update target
affected_projects=$(yarn nx show projects --affected --exclude=shelter --withTarget eas-update)
# Convert the list to a JSON matrix
MATRIX_JSON=$(echo "$affected_projects" | jq -Rcs '
split("\n") |
map(select(. != "")) |
if length == 0 then
{}
else
{include: map({project: .})}
end'
)
IS_MATRIX_EMPTY=$(echo "$MATRIX_JSON" | jq 'if .include | length == 0 then true else false end')
echo "is_matrix_empty=$IS_MATRIX_EMPTY" >> $GITHUB_OUTPUT
echo "matrix=$MATRIX_JSON" >> $GITHUB_OUTPUT
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
is_matrix_empty: ${{ steps.set-matrix.outputs.is_matrix_empty }}
delete-eas-branch:
needs: prepare
runs-on: ubuntu-latest
if: needs.prepare.outputs.is_matrix_empty == 'false'
steps:
- name: πŸ— Check out repo
uses: actions/checkout@v4
- name: πŸ”§ Setup Node
uses: actions/setup-node@v4
with:
node-version: 20.12.2
- run: |
corepack enable
- name: Setup Yarn in Node
uses: actions/setup-node@v4
with:
cache: 'yarn'
- name: πŸ”§ Setup EAS
uses: expo/expo-github-action@v8
with:
eas-version: latest
token: ${{ secrets.EXPO_TOKEN }}
- name: πŸ“¦ Install dependencies
run: yarn install
- name: πŸ—‘οΈ Delete EAS Branch & Channel for Each Project
run: |
BRANCH_NAME=${{ github.head_ref || github.ref_name }}
MATRIX_JSON='${{ needs.prepare.outputs.matrix }}'
for project in $(echo $MATRIX_JSON | jq -r '.include[].project'); do
echo "Deleting EAS branch for project: $project"
# Change to the project directory
cd apps/$project
# Run the EAS command in the project directory
eas branch:delete --non-interactive $BRANCH_NAME
# Change back to the original directory
cd -
done