Skip to content

docs(apple): ANLSPI-23762 update app privacy about AppStore Distribution #126

docs(apple): ANLSPI-23762 update app privacy about AppStore Distribution

docs(apple): ANLSPI-23762 update app privacy about AppStore Distribution #126

Workflow file for this run

name: Image Format
on:
pull_request:
paths:
- 'static/**'
permissions:
contents: write
jobs:
image-format:
name: Image Format
runs-on: macos-latest
if: ${{ github.actor != 'GIOSDK' }} # 禁止套娃
steps:
- name: Checkout
uses: actions/checkout@v3
with:
ref: ${{ github.event.pull_request.head.sha }}
path: ./growingio-sdk-docs
token: ${{ secrets.GIOSDK_PAT }}
- name: Get Current Commit ID
id: get_commit_id
run: |
cd ./growingio-sdk-docs
CURRENT_COMMIT=$(git rev-parse HEAD)
echo "current commit = $CURRENT_COMMIT"
echo "commit_id=$CURRENT_COMMIT" >>$GITHUB_OUTPUT
- name: Checkout avif-cli
uses: actions/checkout@v3
with:
repository: growingio/avif-cli
path: ./avif-cli
- name: Node Version
run: node -v
- name: Image Format
run: |
cd ./avif-cli
npm install
npx webp --input="../growingio-sdk-docs/static/**/*.{jpg,jpeg,png}" --verbose || true
npx avif --input="../growingio-sdk-docs/static/**/*.{jpg,jpeg,png}" --verbose || true
- name: Commit
run: |
cd ./growingio-sdk-docs
if [[ $(git status) == *"nothing to commit"* ]]; then
echo "All Images formatted correctly."
else
COMMIT_ID=${{ steps.get_commit_id.outputs.commit_id }}
git fetch
git checkout ${{ github.head_ref }}
CURRENT_COMMIT=$(git rev-parse HEAD)
echo "current commit = $CURRENT_COMMIT"
if [[ $COMMIT_ID != $CURRENT_COMMIT ]]; then
echo "Skipping commit as there are new pushes."
exit 0
fi
git config user.name GIOSDK
git config user.email [email protected]
git add .
git commit -m "style: image format"
git push origin ${{ github.head_ref }}
fi