-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (60 loc) · 2.58 KB
/
ads-news-posts.yml
File metadata and controls
73 lines (60 loc) · 2.58 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
71
72
73
name: Generate news posts from ADS library
on:
# Run every Monday at 08:00 UTC
schedule:
- cron: "0 8 * * 1"
# Allow manual runs from the GitHub Actions tab
workflow_dispatch:
# Prevent simultaneous runs to avoid compounding ADS rate-limit pressure.
# A newly triggered run will wait for any already-running instance to finish.
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: false
permissions:
contents: write
pull-requests: write
jobs:
ads-news-posts:
runs-on: ubuntu-latest
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install Python dependencies
run: pip install -r scripts/requirements.txt
- name: Generate draft posts from ADS library
env:
ADS_TOKEN: ${{ secrets.ADS_TOKEN }}
run: python scripts/ads_to_posts.py --posts-dir _posts
- name: Check for new posts
id: check
run: |
git add _posts/
if git diff --cached --quiet; then
echo "new_posts=false" >> "$GITHUB_OUTPUT"
else
echo "new_posts=true" >> "$GITHUB_OUTPUT"
fi
- name: Create pull request with new post drafts
if: steps.check.outputs.new_posts == 'true'
uses: peter-evans/create-pull-request@v7
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: ads-news-drafts/${{ github.run_id }}
base: main
commit-message: "news: add draft publication posts from ADS library"
title: "News post drafts from ADS library (${{ github.run_id }})"
body: |
This pull request was opened automatically by the **Generate news posts from ADS library** workflow.
It contains draft Markdown files in `_posts/` for publications found in the [PFITS+ ADS library](https://ui.adsabs.harvard.edu/public-libraries/_-AhcKuYSKyaIu_U5ebVsA) that do not yet have a corresponding news post.
**Before merging, please review each file and:**
- Trim the `tags:` list to 3–6 relevant subject keywords (remove overly specific or administrative ones).
- Verify that all team-member authors have working profile links.
- Confirm the citation line (journal, volume, and page numbers).
- For arXiv preprints, update the entry once the paper is formally published.
See `_posts/README.md` for full formatting conventions.
labels: "news,publications,automated"
draft: false