-
Notifications
You must be signed in to change notification settings - Fork 2
76 lines (62 loc) · 2.19 KB
/
main.yml
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
74
75
76
name: Calendarium Scraper
on:
schedule:
# run every 7 days
- cron: "0 0 * * 0"
workflow_dispatch: # enables manual triggering
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout Code
uses: actions/checkout@v4
- name: Setup Firefox
uses: browser-actions/setup-firefox@v1
- name: Firefox Version
run: firefox --version
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: 3.11.5
- name: Install Dependencies
run: pip install -r scraper/requirements.txt
- name: Run the Scraper
run: python scraper/main.py
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 22.11.0
- name: Setup up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: 1.1.32
- name: Format Code with Prettier
run: |
bun i
bun format
- name: Get Most Active Contributors
id: get_contributors
run: |
# Fetch contributors using GitHub API
contributors=$(curl -s -H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
"https://api.github.com/repos/${{ github.repository }}/contributors?per_page=1")
# Extract the login names of the top contributors
echo "::set-output name=reviewers::$(echo $contributors | jq -r '.[].login' | tr '\n' ',')"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v5
with:
title: "chore: update shifts data"
body: |
*This is an automated PR*
Run Calendarium Scraper in order to update shifts data.
> [!IMPORTANT]
> Before merging, please be aware of edge cases where manual intervention is needed.
commit-message: "chore: update shifts data"
branch: action/shifts
base: master
delete-branch: true
labels: add activities, automated
reviewers: ${{ steps.get_contributors.outputs.reviewers }}
token: ${{ secrets.GITHUB_TOKEN }}
author: "GitHub <[email protected]>"
committer: "GitHub <[email protected]>"