diff --git a/.github/workflows/git-glimpse-ack.yml b/.github/workflows/git-glimpse-ack.yml new file mode 100644 index 0000000..3ce7495 --- /dev/null +++ b/.github/workflows/git-glimpse-ack.yml @@ -0,0 +1,21 @@ +name: GitGlimpse Acknowledge + +on: + issue_comment: + types: [created] + +jobs: + ack: + if: >- + github.event.issue.pull_request != null && + contains(github.event.comment.body, '/glimpse') + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: React with eyes + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \ + --method POST --field content=eyes || true diff --git a/.github/workflows/git-glimpse.yml b/.github/workflows/git-glimpse.yml new file mode 100644 index 0000000..1e9e457 --- /dev/null +++ b/.github/workflows/git-glimpse.yml @@ -0,0 +1,59 @@ +name: GitGlimpse + +on: + pull_request: + types: [opened, synchronize] + issue_comment: + types: [created] + +jobs: + demo: + runs-on: ubuntu-latest + if: >- + github.event_name == 'pull_request' || + (github.event_name == 'issue_comment' && + github.event.issue.pull_request != null && + contains(github.event.comment.body, '/glimpse')) + permissions: + pull-requests: write + contents: write + issues: write + + steps: + - uses: actions/checkout@v4 + with: + fetch-depth: 0 + ref: ${{ github.event_name == 'issue_comment' && format('refs/pull/{0}/head', github.event.issue.number) || '' }} + + - uses: actions/setup-node@v4 + with: + node-version: '20' + + - run: npm ci + + - name: Install FFmpeg + run: sudo apt-get install -y ffmpeg + + - name: Install Playwright Chromium + run: npx playwright install chromium --with-deps + + - uses: DeDuckProject/git-glimpse@v1 + env: + ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }} + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + + - name: React with hooray on success + if: github.event_name == 'issue_comment' && success() + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \ + --method POST --field content=hooray || true + + - name: React with confused on failure + if: github.event_name == 'issue_comment' && failure() + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + gh api repos/$GITHUB_REPOSITORY/issues/comments/${{ github.event.comment.id }}/reactions \ + --method POST --field content=confused || true diff --git a/git-glimpse.config.ts b/git-glimpse.config.ts new file mode 100644 index 0000000..eb78040 --- /dev/null +++ b/git-glimpse.config.ts @@ -0,0 +1,13 @@ +import type { GitGlimpseConfig } from '@git-glimpse/core'; + +export default { + app: { + startCommand: 'npm run dev', + readyWhen: { url: 'http://localhost:5173/epp-demo/' }, + }, + recording: { + format: 'gif', + maxDuration: 30, + viewport: { width: 1280, height: 720 }, + }, +} satisfies GitGlimpseConfig;