-
-
Notifications
You must be signed in to change notification settings - Fork 3
42 lines (42 loc) · 1.53 KB
/
announcements.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
name: Fetch announcements from issue
on: issue_comment
jobs:
issue_commented:
# This job only runs for issue comments
name: Update Announcements
if: |
!github.event.issue.pull_request &&
github.event.issue.number == 181 &&
(github.event.comment.author_association == 'OWNER' ||
github.event.comment.author_association == 'MEMBER' ||
github.event.comment.author_association == 'CONTRIBUTOR' ||
github.event.comment.author_association == 'COLLABORATOR')
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- uses: actions/cache@v2
name: configure pip caching
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/python_requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install Python dependencies
run: |
python -m pip install -r .github/python_requirements.txt
- name: Run update_announcements script
run: |
python update_announcements.py
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: "Update Announcements"
committer: "Hack Bot <uclaacmhack+ghbot@gmail.com>"
author: "Hack Bot <uclaacmhack+ghbot@gmail.com>"
branch: bot/updateAnnouncements
title: '[Automated] Update announcement.json file'
delete-branch: true