Skip to content

Commit e82954a

Browse files
committed
fix: Correct conditionals
1 parent 60b9ca0 commit e82954a

2 files changed

Lines changed: 21 additions & 60 deletions

File tree

.github/workflows/pull_request.yaml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@ on:
77
jobs:
88
lint:
99
runs-on: ubuntu-latest
10-
if: |
11-
(github.repository == 'PolicyEngine/policyengine-us-data')
12-
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
1310
name: Lint
1411
steps:
1512
- uses: actions/checkout@v4
@@ -26,9 +23,6 @@ jobs:
2623
check-version:
2724
name: Check version
2825
runs-on: ubuntu-latest
29-
if: |
30-
(github.repository == 'PolicyEngine/policyengine-us-data')
31-
&& !(github.event.head_commit.message == 'Update PolicyEngine US data')
3226
steps:
3327
- name: Checkout code
3428
uses: actions/checkout@v4
@@ -46,21 +40,9 @@ jobs:
4640
run: ".github/get-changelog-diff.sh"
4741
- name: Check version number has been properly updated
4842
run: ".github/is-version-number-acceptable.sh"
49-
- name: Update changelog
50-
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
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 }}
5843
test:
5944
name: Build and test
6045
runs-on: ubuntu-latest
61-
if: |
62-
(github.repository == 'PolicyEngine/policyengine-us-data')
63-
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
6446
steps:
6547
- name: Checkout code
6648
uses: actions/checkout@v4

.github/workflows/push.yaml

Lines changed: 21 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,9 @@ on:
88
jobs:
99
lint:
1010
runs-on: ubuntu-latest
11-
if: >
12-
github.event_name == 'pull_request' ||
13-
(
14-
github.repository == 'PolicyEngine/policyengine-us-data'
15-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
16-
)
11+
if: |
12+
(github.repository == 'PolicyEngine/policyengine-us-data')
13+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
1714
name: Lint
1815
steps:
1916
- uses: actions/checkout@v4
@@ -30,12 +27,9 @@ jobs:
3027
check-version:
3128
name: Check version
3229
runs-on: ubuntu-latest
33-
if: >
34-
github.event_name == 'pull_request' ||
35-
(
36-
github.repository == 'PolicyEngine/policyengine-us-data'
37-
&& github.event.head_commit.message != 'Update PolicyEngine US data'
38-
)
30+
if: |
31+
(github.repository == 'PolicyEngine/policyengine-us-data')
32+
&& !(github.event.head_commit.message == 'Update PolicyEngine US data')
3933
steps:
4034
- name: Checkout code
4135
uses: actions/checkout@v4
@@ -54,30 +48,19 @@ jobs:
5448
- name: Check version number has been properly updated
5549
run: ".github/is-version-number-acceptable.sh"
5650
- name: Update changelog
57-
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
5851
uses: EndBug/add-and-commit@v9
5952
with:
6053
add: "."
6154
committer_name: Github Actions[bot]
6255
author_name: Github Actions[bot]
6356
message: Update PolicyEngine US data
6457
github_token: ${{ secrets.POLICYENGINE_GITHUB }}
65-
debug-job:
66-
runs-on: ubuntu-latest
67-
steps:
68-
- name: Checkout code
69-
uses: actions/checkout@v4
70-
- name: Debug info
71-
run: |
72-
echo "Event name: ${{ github.event_name }}"
73-
echo "Repository: ${{ github.repository }}"
74-
echo "Commit message: ${{ github.event.head_commit.message }}"
7558
test:
7659
name: Build and test
7760
runs-on: ubuntu-latest
78-
if: >
79-
github.event_name == 'pull_request' ||
80-
github.repository == 'PolicyEngine/policyengine-us-data'
61+
if: |
62+
(github.repository == 'PolicyEngine/policyengine-us-data')
63+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
8164
steps:
8265
- name: Checkout code
8366
uses: actions/checkout@v4
@@ -104,10 +87,9 @@ jobs:
10487
publish-to-pypi:
10588
name: Publish to PyPI
10689
runs-on: ubuntu-latest
107-
if: >
108-
github.repository == 'PolicyEngine/policyengine-us-data'
109-
&& github.event_name == 'push'
110-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
90+
if: |
91+
(github.repository == 'PolicyEngine/policyengine-us-data')
92+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
11193
steps:
11294
- name: Checkout code
11395
uses: actions/checkout@v4
@@ -132,10 +114,9 @@ jobs:
132114
docker:
133115
name: Docker
134116
runs-on: ubuntu-latest
135-
if: >
136-
github.repository == 'PolicyEngine/policyengine-us-data'
137-
&& github.event_name == 'push'
138-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
117+
if: |
118+
(github.repository == 'PolicyEngine/policyengine-us-data')
119+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
139120
steps:
140121
- name: Checkout repo
141122
uses: actions/checkout@v4
@@ -152,10 +133,9 @@ jobs:
152133
publish-docs:
153134
name: Publish documentation
154135
runs-on: ubuntu-latest
155-
if: >
156-
github.repository == 'PolicyEngine/policyengine-us-data'
157-
&& github.event_name == 'push'
158-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
136+
if: |
137+
(github.repository == 'PolicyEngine/policyengine-us-data')
138+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
159139
steps:
160140
- name: Checkout code
161141
uses: actions/checkout@v4
@@ -179,10 +159,9 @@ jobs:
179159
name: Upload data
180160
runs-on: ubuntu-latest
181161
needs: [lint, test]
182-
if: >
183-
github.repository == 'PolicyEngine/policyengine-us-data'
184-
&& github.event_name == 'push'
185-
&& github.event.head_commit.message == 'Update PolicyEngine US data'
162+
if: |
163+
(github.repository == 'PolicyEngine/policyengine-us-data')
164+
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
186165
steps:
187166
- name: Checkout code
188167
uses: actions/checkout@v4

0 commit comments

Comments
 (0)