-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathcommunity-ethical-ai-frameworks-publish.yml
More file actions
62 lines (55 loc) · 2.11 KB
/
Copy pathcommunity-ethical-ai-frameworks-publish.yml
File metadata and controls
62 lines (55 loc) · 2.11 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
# Publishes the next article for community/ethical-ai-frameworks/ every intervalDays (default 25 in manifest).
name: Community Ethical AI Frameworks publish
on:
schedule:
- cron: '30 15 * * *'
workflow_dispatch:
inputs:
force:
description: 'Publish next queued article now (ignore interval)'
required: false
default: false
type: boolean
jobs:
publish:
runs-on: ubuntu-latest
permissions:
contents: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
# Boolean workflow inputs are real booleans — comparing to string 'true' never matches (force was ignored).
- name: Publish next article (if due)
env:
COMMUNITY_SERIES_SUBDIR: ethical-ai-frameworks
run: |
FORCE_PUBLISH=0
if [ "${GITHUB_EVENT_NAME}" = "workflow_dispatch" ]; then
INPUT_FORCE='${{ github.event.inputs.force }}'
if [ "${INPUT_FORCE}" = "true" ] || [ "${INPUT_FORCE}" = "True" ]; then
FORCE_PUBLISH=1
fi
fi
export FORCE_PUBLISH
echo "FORCE_PUBLISH=${FORCE_PUBLISH} (event=${GITHUB_EVENT_NAME})"
python3 scripts/community_llm_safety_publish.py
- name: Commit and push updates
env:
SERIES_DIR: community/ethical-ai-frameworks
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add "$SERIES_DIR/manifest.json" "$SERIES_DIR/topics-queue.json" "$SERIES_DIR/articles/"
if git diff --staged --quiet; then
echo "No publish this run (interval not reached, empty queue, or already up to date)."
exit 0
fi
git commit -m "Community: publish Ethical AI Frameworks article [skip ci]"
git pull --rebase origin "${GITHUB_REF_NAME}"
git push origin "HEAD:${GITHUB_REF_NAME}"