Skip to content

Commit

Permalink
fix: Correct conditionals
Browse files Browse the repository at this point in the history
  • Loading branch information
anth-volk committed Sep 18, 2024
1 parent 60b9ca0 commit e82954a
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 60 deletions.
18 changes: 0 additions & 18 deletions .github/workflows/pull_request.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,6 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
name: Lint
steps:
- uses: actions/checkout@v4
Expand All @@ -26,9 +23,6 @@ jobs:
check-version:
name: Check version
runs-on: ubuntu-latest
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& !(github.event.head_commit.message == 'Update PolicyEngine US data')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -46,21 +40,9 @@ jobs:
run: ".github/get-changelog-diff.sh"
- name: Check version number has been properly updated
run: ".github/is-version-number-acceptable.sh"
- name: Update changelog
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: EndBug/add-and-commit@v9
with:
add: "."
committer_name: Github Actions[bot]
author_name: Github Actions[bot]
message: Update PolicyEngine US data
github_token: ${{ secrets.POLICYENGINE_GITHUB }}
test:
name: Build and test
runs-on: ubuntu-latest
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
63 changes: 21 additions & 42 deletions .github/workflows/push.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,9 @@ on:
jobs:
lint:
runs-on: ubuntu-latest
if: >
github.event_name == 'pull_request' ||
(
github.repository == 'PolicyEngine/policyengine-us-data'
&& github.event.head_commit.message == 'Update PolicyEngine US data'
)
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
name: Lint
steps:
- uses: actions/checkout@v4
Expand All @@ -30,12 +27,9 @@ jobs:
check-version:
name: Check version
runs-on: ubuntu-latest
if: >
github.event_name == 'pull_request' ||
(
github.repository == 'PolicyEngine/policyengine-us-data'
&& github.event.head_commit.message != 'Update PolicyEngine US data'
)
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& !(github.event.head_commit.message == 'Update PolicyEngine US data')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -54,30 +48,19 @@ jobs:
- name: Check version number has been properly updated
run: ".github/is-version-number-acceptable.sh"
- name: Update changelog
# if: github.event_name == 'push' && github.ref == 'refs/heads/main'
uses: EndBug/add-and-commit@v9
with:
add: "."
committer_name: Github Actions[bot]
author_name: Github Actions[bot]
message: Update PolicyEngine US data
github_token: ${{ secrets.POLICYENGINE_GITHUB }}
debug-job:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Debug info
run: |
echo "Event name: ${{ github.event_name }}"
echo "Repository: ${{ github.repository }}"
echo "Commit message: ${{ github.event.head_commit.message }}"
test:
name: Build and test
runs-on: ubuntu-latest
if: >
github.event_name == 'pull_request' ||
github.repository == 'PolicyEngine/policyengine-us-data'
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -104,10 +87,9 @@ jobs:
publish-to-pypi:
name: Publish to PyPI
runs-on: ubuntu-latest
if: >
github.repository == 'PolicyEngine/policyengine-us-data'
&& github.event_name == 'push'
&& github.event.head_commit.message == 'Update PolicyEngine US data'
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -132,10 +114,9 @@ jobs:
docker:
name: Docker
runs-on: ubuntu-latest
if: >
github.repository == 'PolicyEngine/policyengine-us-data'
&& github.event_name == 'push'
&& github.event.head_commit.message == 'Update PolicyEngine US data'
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
steps:
- name: Checkout repo
uses: actions/checkout@v4
Expand All @@ -152,10 +133,9 @@ jobs:
publish-docs:
name: Publish documentation
runs-on: ubuntu-latest
if: >
github.repository == 'PolicyEngine/policyengine-us-data'
&& github.event_name == 'push'
&& github.event.head_commit.message == 'Update PolicyEngine US data'
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -179,10 +159,9 @@ jobs:
name: Upload data
runs-on: ubuntu-latest
needs: [lint, test]
if: >
github.repository == 'PolicyEngine/policyengine-us-data'
&& github.event_name == 'push'
&& github.event.head_commit.message == 'Update PolicyEngine US data'
if: |
(github.repository == 'PolicyEngine/policyengine-us-data')
&& (github.event.head_commit.message == 'Update PolicyEngine US data')
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down

0 comments on commit e82954a

Please sign in to comment.