Skip to content

Commit

Permalink
cicd: update actions and stale settings from template
Browse files Browse the repository at this point in the history
  • Loading branch information
jsstevenson committed Jul 10, 2024
1 parent db75ed8 commit c8f1cf9
Show file tree
Hide file tree
Showing 4 changed files with 74 additions and 29 deletions.
12 changes: 6 additions & 6 deletions .github/workflows/checks.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,10 @@ jobs:
matrix:
python-version: ["3.10", "3.11", "3.12"]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}

Expand All @@ -23,10 +23,10 @@ jobs:
lint:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

Expand All @@ -41,10 +41,10 @@ jobs:
env:
SPHINX_GITHUB_CHANGELOG_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4

- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: 3.11

Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ jobs:
steps:
- uses: actions/checkout@v4
- name: Set up Python
uses: actions/setup-python@v4
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install pypa/build
Expand All @@ -25,7 +25,7 @@ jobs:
- name: Build a binary wheel and a source tarball
run: python3 -m build
- name: Store the distribution packages
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand All @@ -42,7 +42,7 @@ jobs:
id-token: write # IMPORTANT: mandatory for trusted publishing
steps:
- name: Download all the dists
uses: actions/download-artifact@v3
uses: actions/download-artifact@v4
with:
name: python-package-distributions
path: dist/
Expand Down
46 changes: 46 additions & 0 deletions .github/workflows/reusable-stale.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: Reusable Stalebot Workflow

on:
workflow_call:
inputs:
days-before-close:
default: 14
type: number
days-before-issue-stale:
required: true
type: number
days-before-pr-stale:
required: true
type: number
exempt-labels:
default: stale-exempt
description: Comma-separated list of labels to exclude from stalebot
type: string
labels:
default: ""
description: Comma-separated list of labels to apply to stalebot
type: string

jobs:
stale:
runs-on: ubuntu-latest
steps:
- name: Mark issues and PRs as stale
uses: actions/stale@v9
with:
only-labels: ${{ inputs.labels }}
exempt-issue-labels: ${{ inputs.exempt-labels }}
exempt-pr-labels: ${{ inputs.exempt-labels }}
remove-stale-when-updated: true
days-before-close: ${{ inputs.days-before-close }}

days-before-issue-stale: ${{ inputs.days-before-issue-stale }}
stale-issue-label: stale
stale-issue-message: This issue is stale because it has been open ${{ inputs.days-before-issue-stale }} days with no activity. This issue will be closed if no further activity occurs in ${{ inputs.days-before-close }} days.
close-issue-label: closed-by-stale
close-issue-message: This issue was closed because it has been stalled for ${{ inputs.days-before-close }} days with no activity.

days-before-pr-stale: ${{ inputs.days-before-pr-stale }}
stale-pr-label: stale
stale-pr-message: This PR is stale because it has been open ${{ inputs.days-before-pr-stale }} day(s) with no activity. Please review this PR.
days-before-pr-close: -1
39 changes: 19 additions & 20 deletions .github/workflows/stale.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,27 +2,26 @@ name: "Stalebot for issues and PRs"

on:
schedule:
- cron: "30 13 * * *"
- cron: "30 13 * * 1-5"

jobs:
stale:
runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write
steps:
- uses: actions/stale@v9
with:
remove-stale-when-updated: true
days-before-close: 14
stale-high-priority:
uses: ./.github/workflows/reusable-stale.yaml
with:
days-before-issue-stale: 90
days-before-pr-stale: 1
labels: priority:high

days-before-issue-stale: 60
stale-issue-label: stale
stale-issue-message: "This issue is stale because it has been open 45 days with no activity. Please make a comment for triaging or closing the issue."
close-issue-label: closed-by-stale
close-issue-message: "This issue was closed because it has been stalled for 14 days with no activity."
stale-medium-priority:
uses: ./.github/workflows/reusable-stale.yaml
with:
days-before-issue-stale: 135
days-before-pr-stale: 3
labels: priority:medium

days-before-pr-stale: 7
stale-pr-label: stale
stale-pr-message: "This PR is stale because it has been open 7 days with no activity. Please review this PR."
days-before-pr-close: -1
stale-low-priority:
uses: ./.github/workflows/reusable-stale.yaml
with:
days-before-issue-stale: 180
days-before-pr-stale: 7
labels: priority:low

0 comments on commit c8f1cf9

Please sign in to comment.