From b49487c94bf077095a61cb7cabefc70ec13e89ab Mon Sep 17 00:00:00 2001 From: Althea Denlinger Date: Mon, 9 Dec 2024 13:25:53 -0800 Subject: [PATCH 1/2] Fix build workflow jobs canceling other jobs --- .github/workflows/build_workflow.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/build_workflow.yml b/.github/workflows/build_workflow.yml index 5f4dbdc9..9316f259 100644 --- a/.github/workflows/build_workflow.yml +++ b/.github/workflows/build_workflow.yml @@ -26,6 +26,7 @@ jobs: strategy: matrix: python-version: ["3.9", "3.10", "3.11", "3.12", "3.13"] + fail-fast: false steps: - id: skip_check uses: fkirc/skip-duplicate-actions@master From a5159d4135b9e0ab31f40148697143feb04c58c0 Mon Sep 17 00:00:00 2001 From: Althea Denlinger Date: Mon, 9 Dec 2024 13:32:30 -0800 Subject: [PATCH 2/2] Add pre-commit autoupdate action --- .../workflows/pre_commit_update_workflow.yml | 68 +++++++++++++++++++ 1 file changed, 68 insertions(+) create mode 100644 .github/workflows/pre_commit_update_workflow.yml diff --git a/.github/workflows/pre_commit_update_workflow.yml b/.github/workflows/pre_commit_update_workflow.yml new file mode 100644 index 00000000..544b5062 --- /dev/null +++ b/.github/workflows/pre_commit_update_workflow.yml @@ -0,0 +1,68 @@ +name: Pre-commit auto-update + +on: + schedule: + # Cron syntax: + # 1. Entry: Minute when the process will be started [0-60] + # 2. Entry: Hour when the process will be started [0-23] + # 3. Entry: Day of the month when the process will be started [1-28/29/30/31] + # 4. Entry: Month of the year when the process will be started [1-12] + # 5. Entry: Weekday when the process will be started [0-6] [0 is Sunday] + - cron: '0 8 * * 3' + +env: + UP_TO_DATE: false + +jobs: + auto-update: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: "3.10" + + - name: Install pre-commit + run: pip install pre-commit + + - name: Apply and commit updates + run: | + git clone https://github.com/MPAS-Dev/geometric_features.git update-pre-commit-deps + cd update-pre-commit-deps + # Configure git using GitHub Actions credentials. + git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" + git config --local user.name "github-actions[bot]" + git checkout -b update-pre-commit-deps + pre-commit autoupdate + git add . + # Either there are changes, in which case we commit them, or there are no changes, + # in which case we can skip the push & pr-create jobs + git commit -m "Update pre-commit dependencies" \ + || ( echo "UP_TO_DATE=true" >> "$GITHUB_ENV") + + - name: Push Changes + if: ${{ env.UP_TO_DATE == 'false' }} + uses: ad-m/github-push-action@master + with: + branch: update-pre-commit-deps + directory: update-pre-commit-deps + github_token: ${{ secrets.GITHUB_TOKEN }} + force: true + env: + GH_TOKEN: ${{ github.token }} + + - name: Make PR and add reviewers and labels + if: ${{ env.UP_TO_DATE == 'false' }} + run: | + cd update-pre-commit-deps + gh pr create \ + --title "Update pre-commit and its dependencies" \ + --body "This PR was auto-generated to update pre-commit and its dependencies." \ + --head update-pre-commit-deps \ + --reviewer altheaden,xylar \ + --label ci + env: + GH_TOKEN: ${{ github.token }} +