-
Notifications
You must be signed in to change notification settings - Fork 12
39 lines (36 loc) · 1.49 KB
/
branch_push_workflow.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
name: Pushed branch commit workflow
on:
#For some reason GitHub does not allow secrets
#when a PR from a fork is closed. Thus instead
#the workflow must activate whenever a commit
#is pushed to the repo. Theoretically this should
#behave the same way as if triggered from a pull
#request, just as long as no user ever pushes
#directly to the repo.
push:
branches:
- '**' # Trigger workflow on push to any branch or branch hierarchy.
jobs:
#This job is designed to close any issues or pull requests specified
#in the body of a pull request merged into a non-default branch.
issue_closer:
if: github.repository == 'ESCOMP/CAM-SIMA' # Only run on main repo
runs-on: ubuntu-latest
steps:
# Acquire github action routines
- uses: actions/checkout@v3
# Acquire specific version of python
- name: Set up Python 3.10
uses: actions/setup-python@v4
with:
python-version: '3.10' # Semantic version range syntax or exact version of a Python version
# Install required python packages
- name: Install dependencies
run: |
python -m pip install --upgrade pip # Install latest version of PIP
pip install PyGithub # Install PyGithub python package
# Run CAM issue-closing script
- name: Run python Github issue-closing script
env:
ACCESS_TOKEN: ${{ secrets.WRITE_ACCESS_TOKEN }}
run: .github/scripts/branch_pr_issue_closer.py --access_token $ACCESS_TOKEN --trigger_sha $GITHUB_SHA