Repository navigation
70 lines (70 loc) · 2.39 KB
/
Copy pathdiscover.yml
File metadata and controls
70 lines (70 loc) · 2.39 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
name: Collect publication candidates
on:
workflow_dispatch:
schedule:
- cron: '17 15 * * 1'
permissions:
contents: write
pull-requests: write
actions: write
concurrency:
group: publication-review
cancel-in-progress: false
jobs:
collect:
if: vars.WEBSITE_MAINTENANCE_ENABLED == 'true'
runs-on: ubuntu-latest
timeout-minutes: 20
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BASE_BRANCH: ${{ github.event.repository.default_branch }}
steps:
- uses: actions/checkout@v7.0.1
with:
ref: ${{ github.event.repository.default_branch }}
fetch-depth: 0
- uses: actions/setup-node@v7.0.0
with:
node-version: 24
cache: npm
- uses: actions/setup-python@v7.0.0
with:
python-version: '3.12'
- name: Continue the existing review branch without overwriting reviewer edits
run: |
git config user.name 'github-actions[bot]'
git config user.email '41898282+github-actions[bot]@users.noreply.github.com'
branch='codex/weekly-publication-review'
if git show-ref --verify --quiet "refs/remotes/origin/$branch"; then
git switch -c "$branch" "origin/$branch"
git merge --no-edit "origin/$BASE_BRANCH"
else
git switch -c "$branch"
fi
- uses: actions/cache/restore@v6.1.0
with:
path: .cache
key: discovery-${{ github.run_id }}-${{ github.run_attempt }}
restore-keys: discovery-
- run: npm ci
- name: Validate enabled configuration
run: |
python3 scripts/validate-maintenance.py
python3 -c "import json; assert json.load(open('maintenance/config.json'))['enabled'], 'Enable maintenance/config.json before activation'"
- name: Discover candidates
env:
OPENALEX_API_KEY: ${{ secrets.OPENALEX_API_KEY }}
run: python3 scripts/publication_pipeline.py collect
- run: npm run check
- name: Publish review branch and request checks
run: python3 scripts/publish_batch.py
- uses: actions/cache/save@v6.1.0
with:
path: .cache
key: discovery-${{ github.run_id }}-${{ github.run_attempt }}
- uses: actions/upload-artifact@v7.0.1
with:
name: review-preview
path: out
include-hidden-files: true
retention-days: 14