Skip to content
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
66 changes: 66 additions & 0 deletions .github/workflows/temporary-soft-copyright-manual.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Temporary soft copyright manual evidence

on:
pull_request:
branches: [develop]
paths:
- '.github/workflows/temporary-soft-copyright-manual.yml'
- 'scripts/temporary-soft-copyright-manual-crawl.mjs'

permissions:
contents: read

jobs:
capture:
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- name: Checkout evidence branch
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: '22'

- name: Install Playwright
run: |
mkdir -p /tmp/partnerup-crawler
cd /tmp/partnerup-crawler
npm init -y
npm install --no-save playwright@1.55.0
npx playwright install --with-deps chromium

- name: Capture mobile site evidence
continue-on-error: true
env:
NODE_PATH: /tmp/partnerup-crawler/node_modules
PARTNERUP_BASE_URL: https://app.partner-up.cn
SOURCE_COMMIT: 30f51b96e2498b4b85014552512a31a7345d86cb
MAX_PAGES: '25'
run: |
mkdir -p soft-copyright-manual-evidence
cp scripts/temporary-soft-copyright-manual-crawl.mjs /tmp/partnerup-crawler/crawl.mjs
set +e
node /tmp/partnerup-crawler/crawl.mjs 2>&1 | tee soft-copyright-manual-evidence/crawl.log
crawl_status=${PIPESTATUS[0]}
set -e
tar -czf soft-copyright-manual-evidence/apps-web-source.tar.gz \
apps/web/package.json apps/web/src
git ls-tree -r --name-only 30f51b96e2498b4b85014552512a31a7345d86cb -- apps/web \
> soft-copyright-manual-evidence/apps-web-files.txt
printf '%s\n' '30f51b96e2498b4b85014552512a31a7345d86cb' \
> soft-copyright-manual-evidence/source-commit.txt
printf '%s\n' "$crawl_status" > soft-copyright-manual-evidence/crawl-exit-code.txt
exit "$crawl_status"

- name: Upload evidence
if: always()
uses: actions/upload-artifact@v4
with:
name: partner-up-mobile-manual-evidence
path: soft-copyright-manual-evidence
if-no-files-found: error
retention-days: 7
5 changes: 5 additions & 0 deletions scripts/temporary-soft-copyright-manual-crawl.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
import fs from 'node:fs';
import path from 'node:path';
import { chromium } from 'playwright';

// Temporary read-only evidence crawler. This branch is reset after artifact collection.
Loading