|
4 | 4 | repository_dispatch: |
5 | 5 | types: |
6 | 6 | - set-new-golden |
7 | | - - set-new-golden-overwrite |
8 | 7 |
|
9 | 8 | jobs: |
10 | 9 | update: |
|
29 | 28 | API_BASE_URL: ${{ secrets.API_BASE_URL }} |
30 | 29 | run: | |
31 | 30 | echo ${{ github.event_name }} |
32 | | - echo ${{ github.event.client_payload.event_type }} |
33 | | - if [[ "${{ github.event_name }}" == "repository_dispatch" && "${{ github.event.client_payload.event_type }}" == "set-new-golden-overwrite" ]]; then |
| 31 | + echo ${{ github.event.client_payload.type }} |
| 32 | + if [[ "${{ github.event_name }}" == "repository_dispatch" && "${{ github.event.client_payload.type }}" == "overwrite" ]]; then |
34 | 33 | python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --overwrite |
35 | 34 | else |
36 | 35 | python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} |
|
58 | 57 | branch: bot-update-rules |
59 | 58 | commit-message: | |
60 | 59 | [BOT] Update rules |
61 | | - overwrite: |
62 | | - runs-on: ubuntu-latest |
63 | | - strategy: |
64 | | - fail-fast: false |
65 | | - if: github.event_name == 'repository_dispatch' && github.event.client_payload.event_type == 'set-new-golden-overwrite' |
66 | | - steps: |
67 | | - - name: Check out repository code recursively |
68 | | - uses: actions/checkout@v3 |
69 | | - with: |
70 | | - submodules: recursive |
71 | | - fetch-depth: 0 |
72 | | - - uses: actions/setup-python@v4 |
73 | | - with: |
74 | | - python-version: "3.10" |
75 | | - - name: Install Python Packages |
76 | | - run: | |
77 | | - pip install firebase-admin |
78 | | - - name: Execute Python Script |
79 | | - env: |
80 | | - CREDS_FILE: ${{ secrets.CREDS_FILE }} |
81 | | - API_BASE_URL: ${{ secrets.API_BASE_URL }} |
82 | | - run: python flow/util/updateRules.py --keyFile "${CREDS_FILE}" --apiURL ${API_BASE_URL} --overwrite |
83 | | - - name: Push updated rules |
84 | | - id: remote-update |
85 | | - run: | |
86 | | - git config --local user.email "github-actions[bot]@users.noreply.github.com" |
87 | | - git config --local user.name "github-actions[bot]" |
88 | | - echo "::set-output name=has_update::$(git --no-pager diff --name-only origin/master..HEAD)" |
89 | | - git add . |
90 | | - git commit -m "flow: update rules based on new golden reference" |
91 | | - - if: "steps.remote-update.outputs.has_update != ''" |
92 | | - name: Create Draft PR |
93 | | - uses: peter-evans/create-pull-request@v5 |
94 | | - with: |
95 | | - token: ${{ github.token }} |
96 | | - signoff: true |
97 | | - delete-branch: true |
98 | | - title: "[BOT] Update rules" |
99 | | - reviewers: | |
100 | | - vvbandeira |
101 | | - maliberty |
102 | | - draft: true |
103 | | - branch: bot-update-rules |
104 | | - commit-message: | |
105 | | - [BOT] Update rules |
0 commit comments