Skip to content

Commit a78dcc1

Browse files
authored
Merge pull request #354 from altheaden/fix-update-pre-commit-workflow
Switch `pre-commit` update workflow to use conda; various small changes
2 parents 08d929a + f538a11 commit a78dcc1

File tree

2 files changed

+25
-7
lines changed

2 files changed

+25
-7
lines changed

.github/dependabot.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,3 +11,4 @@ updates:
1111
reviewers:
1212
- "xylar"
1313
- "altheaden"
14+
- "andrewdnolan"

.github/workflows/pre_commit_update_workflow.yml

Lines changed: 24 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -9,27 +9,44 @@ on:
99
# 4. Entry: Month of the year when the process will be started [1-12]
1010
# 5. Entry: Weekday when the process will be started [0-6] [0 is Sunday]
1111
- cron: '0 8 * * 3'
12+
# Allow manual triggering of the workflow
13+
workflow_dispatch:
1214

1315
env:
1416
UP_TO_DATE: false
15-
PYTHON_VERSION: "3.10"
17+
PYTHON_VERSION: "3.13"
18+
REVIEWERS: "altheaden,xylar,andrewdnolan"
1619

1720
jobs:
1821
auto-update:
1922
runs-on: ubuntu-latest
2023
steps:
2124
- uses: actions/checkout@v4
2225

23-
- name: Set up Python
24-
uses: actions/setup-python@v5
26+
- name: Set up Conda Environment
27+
uses: mamba-org/setup-micromamba@v2
2528
with:
26-
python-version: ${{ env.PYTHON_VERSION }}
29+
environment-name: pre_commit_dev
30+
init-shell: bash
31+
condarc: |
32+
channel_priority: strict
33+
channels:
34+
- conda-forge
35+
create-args: >-
36+
python=${{ env.PYTHON_VERSION }}
2737
28-
- name: Install pre-commit
29-
run: pip install pre-commit
38+
- name: Install pre-commit and gh
39+
run: |
40+
eval "$(micromamba shell hook --shell bash)"
41+
micromamba activate pre_commit_dev
42+
# permissions issue with gh 2.76.0
43+
conda install -y pre-commit "gh !=2.76.0"
44+
gh --version
3045
3146
- name: Apply and commit updates
3247
run: |
48+
eval "$(micromamba shell hook --shell bash)"
49+
micromamba activate pre_commit_dev
3350
git clone https://github.com/E3SM-Project/polaris.git update-pre-commit-deps
3451
cd update-pre-commit-deps
3552
# Configure git using GitHub Actions credentials.
@@ -60,7 +77,7 @@ jobs:
6077
--title "Update pre-commit and its dependencies" \
6178
--body "This PR was auto-generated to update pre-commit and its dependencies." \
6279
--head update-pre-commit-deps \
63-
--reviewer altheaden,xylar \
80+
--reviewer ${{ env.REVIEWERS }} \
6481
--label ci
6582
env:
6683
GH_TOKEN: ${{ github.token }}

0 commit comments

Comments
 (0)