Skip to content

test grep -c

test grep -c #9

Workflow file for this run

name: deps-sync
on:
schedule:
- cron: 0 17 * * FRI
- cron: 10,40 17,18,19 * * FRI
workflow_dispatch:
inputs:
mode:
type: choice
options:
- main_to_deps_merge
- deps_to_main_pull_request
push:
branches:
- deps-syncer
jobs:
main_to_deps_merge:
if: contains(github.ref_name, 'deps-syncer') || github.event.inputs.mode == 'main_to_deps_merge' || github.event.schedule == '10,40 17,18,19 * * FRI'
runs-on: ubuntu-latest
steps:
- id: checkout_deps
uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.GITHUB_TOKEN }}
ref: deps
- run: git log -n 5
- run: git config --global user.name mergebot
- run: git config --global user.email "mergebot@users.noreply.github.com"
- run: git fetch
- run: git merge --strategy-option theirs origin/main
- run: corepack enable
- run: pnpm install --no-frozen-lockfile
- run: |
GIT_STATUS=$(git status --porcelain)
if [ -z "$GIT_STATUS" ]; then
echo "no changes made. git status:"
git status
else
git add .
git commit -m 'chore: changes after pnpm install' --no-verify
fi
- run: git log -n 5
- run: git status
- run: echo hi | grep -c h
- run: |
is_ahead=$(git status | LC_ALL=C grep -c 'Your branch is ahead')
echo "is_ahead: $is_ahead"
- run: |
is_ahead=$(git status | grep -c 'Your branch is ahead')
echo "is_ahead: $is_ahead"
if [ "$is_ahead" -eq 1 ]; then
echo git push
else
git status
echo "no changes to push"
fi
deps_to_main_pull_request:
if: github.event.inputs.mode == 'deps_to_main_pull_request' || github.event.schedule == '0 17 * * FRI'
runs-on: ubuntu-latest
steps:
- run: echo todo