Skip to content

test: ci test for PR-2451 #2452

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 6 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:

jobs:
crowdin:
if: github.repository == 'docsifyjs/docsify'
runs-on: ubuntu-latest
steps:
- name: Checkout
Expand Down
55 changes: 23 additions & 32 deletions .github/workflows/update-emoji.yml
Original file line number Diff line number Diff line change
@@ -1,53 +1,44 @@
name: Update Emoji
name: Sync Emoji

on:
schedule:
- cron: '0 2 * * *'
workflow_dispatch:

concurrency:
group: update-emoji-group

jobs:
sync-emojis-from-github:
sync-emoji:
if: github.repository == 'docsifyjs/docsify'
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
ref: mock-emoji-late

- name: Setup Node.js v20
uses: actions/setup-node@v4
- uses: actions/setup-node@v4
with:
node-version: 20
node-version: latest
cache: 'npm'

- name: Install dependencies
run: npm ci --ignore-scripts

- name: Fetch emojiData
- name: Run script to update emoji data
run: npm run build:emoji

- name: Check for changes
- name: Commit
id: auto-commit-action
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_message: 'chore: Sync emoji data with GitHub emoji API'
branch: sync-emoji
create_branch: true
file_pattern: 'src/core/render/emoji-data.js docs/emoji.md'
push_options: '--force'

- name: Create Pull Request
if: ${{ steps.auto-commit-action.outputs.changes_detected == 'true' }}
run: |
if git diff --quiet -- "src/core/render/emoji-data.js"; then
echo "No changes Found. Skipping PR creation."
else
echo "Changes detected in emoji-data.js. Creating PR."

current_date=$(date +'%Y-%m-%d')

branch_name="update-emoji-data-$current_date"
pr_title="update(emoji): Sync emoji data with GitHub emoji API [$current_date]"
git config --global user.email "actions@github.com"
git config --global user.name "GitHub Actions"

git checkout -b $branch_name
git add src/core/render/emoji-data.js
git add docs/emoji.md
git commit -m "update(emoji): Sync emoji data with GitHub emoji API [$current_date]"
unique_branch_name=$branch_name-$(git log -1 --pretty=%h)
git checkout -b $unique_branch_name
git push origin $unique_branch_name
gh pr create --title "$pr_title" --body "Found updated github emojis need to sync, PTAL @docsifyjs/reviewers :robot:." --base develop
fi
gh pr create --title 'chore: Sync emoji data with GitHub emoji API' --body 'Found updated github emojis need to sync.' --base mock-emoji-late --reviewer docsifyjs/reviewers
continue-on-error: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_TOKEN: ${{ secrets.READ_TEAM_TOKEN }}
Loading