Skip to content

Commit

Permalink
Fix CI errors - slash in branch name and Python version (#1983)
Browse files Browse the repository at this point in the history
  • Loading branch information
georgemccabe authored Dec 9, 2022
1 parent f19da0c commit 2418b39
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 11 deletions.
9 changes: 6 additions & 3 deletions .github/jobs/docker_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,18 +61,21 @@ def get_branch_name():
# get branch name from env var BRANCH_NAME
branch_name = os.environ.get('BRANCH_NAME')
if branch_name:
return branch_name
return branch_name.replace('/', '_')

# if BRANCH_NAME not set, use GITHUB env vars
github_event_name = os.environ.get('GITHUB_EVENT_NAME')
if not github_event_name:
return None

if github_event_name == 'pull_request':
return os.environ.get('GITHUB_HEAD_REF')
branch_name = os.environ.get('GITHUB_HEAD_REF')
if branch_name:
branch_name = branch_name.replace('/', '_')
return branch_name

github_ref = os.environ.get('GITHUB_REF')
if github_ref is None:
return None

return github_ref.replace('refs/heads/', '')
return github_ref.replace('refs/heads/', '').replace('/', '_')
8 changes: 4 additions & 4 deletions .github/workflows/documentation.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@ on:
push:
branches:
- develop
- feature_*
- main_*
- bugfix_*
- feature_**
- main_**
- bugfix_**
paths:
- docs/**
pull_request:
Expand All @@ -19,7 +19,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
python-version: '3.8'
- name: Install dependencies
run: |
python -m pip install --upgrade sphinx sphinx-gallery sphinx_rtd_theme
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ on:
branches:
- develop
- develop-ref
- 'feature_*'
- 'main_*'
- 'bugfix_*'
- 'feature_**'
- 'main_**'
- 'bugfix_**'
paths-ignore:
- 'docs/**'

Expand Down Expand Up @@ -78,7 +78,7 @@ jobs:
- uses: actions/checkout@v2
- uses: actions/setup-python@v2
with:
python-version: '3.6'
python-version: '3.8'
- name: Get METplus Image
run: .github/jobs/docker_setup.sh
env:
Expand Down

0 comments on commit 2418b39

Please sign in to comment.