forked from The-OpenROAD-Project/OpenROAD-flow-scripts
-
Notifications
You must be signed in to change notification settings - Fork 0
62 lines (61 loc) · 2.09 KB
/
github-actions-update-rules.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
name: Create draft PR for updated rules
on:
repository_dispatch:
types:
- set-new-golden
jobs:
update:
runs-on: ubuntu-latest
strategy:
fail-fast: false
steps:
- name: Check out repository code recursively
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0
- uses: actions/setup-python@v4
with:
python-version: "3.10"
- name: Install Python Packages
run: |
pip install firebase-admin
- name: Execute Python Script Update
env:
CREDS_FILE: ${{ secrets.CREDS_FILE }}
API_BASE_URL: ${{ secrets.API_BASE_URL }}
run: |
echo ${{ github.event_name }}
echo ${{ github.event.client_payload.type }}
if [[ "${{ github.event_name }}" == "repository_dispatch" && "${{ github.event.client_payload.type }}" == "overwrite" ]]; then
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --overwrite
else
python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL}
fi
- name: Push updated rules
id: remote-update
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
if [ -n "$(git status --porcelain)" ]; then
echo "has_update=true" >> "$GITHUB_OUTPUT"
else
echo "has_update=false" >> "$GITHUB_OUTPUT"
fi
git add .
git commit -m "flow: update rules based on new golden reference"
- if: "steps.remote-update.outputs.has_update == 'true'"
name: Create Draft PR
uses: peter-evans/create-pull-request@v5
with:
token: ${{ github.token }}
signoff: true
delete-branch: true
title: "[BOT] Update rules"
reviewers: |
vvbandeira
maliberty
draft: true
branch: bot-update-rules
commit-message: |
[BOT] Update rules