1- name : Push
1+ # After successful versioning, this script runs various
2+ # parts of the push process
3+ name : Push 2
24
35on :
4- push :
5- branches : [main ]
6- workflow_dispatch :
6+ workflow_run :
7+ workflows : ["Push 1" ]
8+ types : [completed]
79
810jobs :
911 lint :
1012 runs-on : ubuntu-latest
11- if : |
12- (github.repository == 'PolicyEngine/policyengine-us-data')
13- && (github.event.head_commit.message == 'Update PolicyEngine US data')
13+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
1414 name : Lint
1515 steps :
1616 - uses : actions/checkout@v4
@@ -24,43 +24,10 @@ jobs:
2424 pip install black
2525 - name : Check formatting
2626 run : black . -l 79 --check
27- check-version :
28- name : Check version
29- runs-on : ubuntu-latest
30- if : |
31- (github.repository == 'PolicyEngine/policyengine-us-data')
32- && !(github.event.head_commit.message == 'Update PolicyEngine US data')
33- steps :
34- - name : Checkout code
35- uses : actions/checkout@v4
36- with :
37- fetch-depth : 0 # Fetch all history for all tags and branches
38- repository : ${{ github.event.pull_request.head.repo.full_name }}
39- ref : ${{ github.event.pull_request.head.ref }}
40- - name : Set up Python
41- uses : actions/setup-python@v5
42- with :
43- python-version : 3.12
44- - name : Build changelog
45- run : pip install "yaml-changelog>=0.1.7" && make changelog
46- - name : Preview changelog update
47- run : " .github/get-changelog-diff.sh"
48- - name : Check version number has been properly updated
49- run : " .github/is-version-number-acceptable.sh"
50- - name : Update changelog
51- uses : EndBug/add-and-commit@v9
52- with :
53- add : " ."
54- committer_name : Github Actions[bot]
55- author_name : Github Actions[bot]
56- message : Update PolicyEngine US data
57- github_token : ${{ secrets.POLICYENGINE_GITHUB }}
5827 test :
5928 name : Build and test
6029 runs-on : ubuntu-latest
61- if : |
62- (github.repository == 'PolicyEngine/policyengine-us-data')
63- && (github.event.head_commit.message == 'Update PolicyEngine US data')
30+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
6431 steps :
6532 - name : Checkout code
6633 uses : actions/checkout@v4
8754 publish-to-pypi :
8855 name : Publish to PyPI
8956 runs-on : ubuntu-latest
90- if : |
91- (github.repository == 'PolicyEngine/policyengine-us-data')
92- && (github.event.head_commit.message == 'Update PolicyEngine US data')
57+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
9358 steps :
9459 - name : Checkout code
9560 uses : actions/checkout@v4
11479 docker :
11580 name : Docker
11681 runs-on : ubuntu-latest
117- if : |
118- (github.repository == 'PolicyEngine/policyengine-us-data')
119- && (github.event.head_commit.message == 'Update PolicyEngine US data')
82+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
12083 steps :
12184 - name : Checkout repo
12285 uses : actions/checkout@v4
13396 publish-docs :
13497 name : Publish documentation
13598 runs-on : ubuntu-latest
136- if : |
137- (github.repository == 'PolicyEngine/policyengine-us-data')
138- && (github.event.head_commit.message == 'Update PolicyEngine US data')
99+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
139100 steps :
140101 - name : Checkout code
141102 uses : actions/checkout@v4
@@ -159,9 +120,7 @@ jobs:
159120 name : Upload data
160121 runs-on : ubuntu-latest
161122 needs : [lint, test]
162- if : |
163- (github.repository == 'PolicyEngine/policyengine-us-data')
164- && (github.event.head_commit.message == 'Update PolicyEngine US data')
123+ if : ${{ github.event.workflow_run.conclusion == 'success' }}
165124 steps :
166125 - name : Checkout code
167126 uses : actions/checkout@v4
0 commit comments