Skip to content

Commit 05de658

Browse files
committed
Created Actions workflows
1 parent 601fee8 commit 05de658

File tree

2 files changed

+84
-0
lines changed

2 files changed

+84
-0
lines changed

.github/workflows/eslint.yml

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
name: ESLint
2+
3+
on: [push, pull_request]
4+
5+
jobs:
6+
eslint:
7+
runs-on: ubuntu-latest
8+
steps:
9+
10+
- name: Checkout repository code
11+
uses: actions/checkout@v4
12+
13+
- name: Set up Node.js
14+
uses: actions/setup-node@v4
15+
with:
16+
node-version: 21
17+
18+
- name: Install dependencies
19+
run: npm ci # instead of install to ensure consistency and determinism in CI/CD workflow
20+
21+
- name: Run ESLint
22+
run: npm run lint

.github/workflows/sync-changes.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
name: Sync * to adamlui/ai-apps/perplexity-omnibox/*
2+
3+
on:
4+
push:
5+
branches: [main]
6+
paths: ["**", "!.*", "!package*json", "!eslint.config*"]
7+
8+
jobs:
9+
build:
10+
if: (github.repository == 'adamlui/perplexity-omnibox') && (github.event.commits[0].committer.username != 'kudo-sync-bot')
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
15+
- name: Checkout adamlui/perplexity-omnibox
16+
uses: actions/checkout@v4
17+
with:
18+
token: ${{ secrets.REPO_SYNC_PAT }}
19+
repository: adamlui/perplexity-omnibox
20+
path: adamlui/perplexity-omnibox
21+
22+
- name: Checkout adamlui/ai-apps
23+
uses: actions/checkout@v4
24+
with:
25+
token: ${{ secrets.REPO_SYNC_PAT }}
26+
repository: adamlui/ai-apps
27+
path: adamlui/ai-apps
28+
29+
- name: Sync * to adamlui/ai-apps/perplexity-omnibox/*
30+
run: |
31+
rsync -avhr --delete --exclude={'.*','eslint*','package*json'} \
32+
${{ github.workspace }}/adamlui/perplexity-omnibox/ \
33+
${{ github.workspace }}/adamlui/ai-apps/perplexity-omnibox/
34+
35+
- name: Escape backticks in commit msg
36+
env:
37+
COMMIT_MSG: ${{ github.event.head_commit.message }}
38+
run: |
39+
echo "ESCAPED_MSG<<EOF" >> $GITHUB_ENV
40+
echo "$COMMIT_MSG" | sed 's/`/\`/g' >> $GITHUB_ENV
41+
echo "EOF" >> $GITHUB_ENV
42+
43+
- name: Config committer
44+
run: |
45+
gpg --batch --import <(echo "${{ secrets.GPG_PRIVATE_KEY }}")
46+
git config --global user.name "kudo-sync-bot"
47+
git config --global user.email "[email protected]"
48+
git config --global user.signingkey "${{ secrets.GPG_PRIVATE_ID }}"
49+
50+
- name: Push changes to adamlui/perplexity-omnibox
51+
run: |
52+
cd ${{ github.workspace }}/adamlui/perplexity-omnibox
53+
git add .
54+
git commit -S -n -m "$ESCAPED_MSG ↞ [auto-sync from \`adamlui/perplexity-omnibox\`]" || true
55+
git push
56+
57+
- name: Push changes to adamlui/ai-apps
58+
run: |
59+
cd ${{ github.workspace }}/adamlui/ai-apps
60+
git add .
61+
git commit -S -n -m "$ESCAPED_MSG ↞ [auto-sync from \`adamlui/perplexity-omnibox\`]" || true
62+
git push

0 commit comments

Comments
 (0)