forked from USRSE/usrse.github.io
-
Notifications
You must be signed in to change notification settings - Fork 0
50 lines (44 loc) · 1.58 KB
/
member-counts.yaml
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
name: Update Membership Counts
on:
schedule:
# Run on the first of every month
- cron: 0 0 1 * *
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: 3.9
- name: Install required packages
run: |
pip install requests
- name: Remove Expired Jobs
run: |
python scripts/update_counts.py
- name: Checkout New Branch
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo "GitHub Actor: ${GITHUB_ACTOR}"
git remote set-url origin "https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git"
git branch
git checkout -b update/member-count-$(date '+%Y-%m-%d')
git branch
git config --global user.name "github-actions"
git config --global user.email "github-actions@users.noreply.github.com"
git add _data/memberCounts.csv
git commit -m "Automated deployment to update Member Counts $(date '+%Y-%m-%d')" --allow-empty
git push origin update/member-count-$(date '+%Y-%m-%d')
- name: Open pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
BRANCH_AGAINST: "main"
run: |
export BRANCH_FROM="update/member-count-$(date '+%Y-%m-%d')"
wget https://raw.githubusercontent.com/USRSE/usrse.github.io/71ae72c2a5524c502e0bb51c5ca764dd854eea18/scripts/pull-request.sh
chmod +x ./pull-request.sh
/bin/bash ./pull-request.sh