Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .copier-answers.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# WARNING: Do not edit this file manually.
# Any changes will be overwritten by Copier.
_commit: v0.10.1-41-g508666e
_commit: v0.11.0-7-gb5113cf
_src_path: gh:easyscience/templates
lib_docs_url: https://easyscience.github.io/templates
lib_doi: 10.5281/zenodo.18163581
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/download-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Download artifact'
description: 'Generic wrapper for actions/download-artifact'
description: 'Wrapper for actions/download-artifact'
inputs:
name:
description: 'Name of the artifact to download'
Expand Down Expand Up @@ -39,7 +39,7 @@ runs:
using: 'composite'
steps:
- name: Download artifact
uses: actions/download-artifact@v4
uses: actions/download-artifact@v8
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
Expand Down
2 changes: 1 addition & 1 deletion .github/actions/github-script/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ inputs:
runs:
using: 'composite'
steps:
- uses: actions/github-script@v8
- uses: actions/github-script@v9
with:
script: ${{ inputs.script }}
github-token: ${{ inputs.github-token }}
4 changes: 2 additions & 2 deletions .github/actions/setup-easyscience-bot/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ runs:
steps:
- name: Create GitHub App installation token
id: app-token
uses: actions/create-github-app-token@v2
uses: actions/create-github-app-token@v3
with:
app-id: ${{ inputs.app-id }}
client-id: ${{ inputs.app-id }}
private-key: ${{ inputs.private-key }}
repositories: ${{ inputs.repositories }}

Expand Down
2 changes: 1 addition & 1 deletion .github/actions/setup-pixi/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Setup Pixi Environment'
description: 'Sets up pixi with common configuration'
description: 'Wrapper for prefix-dev/setup-pixi'
inputs:
environments:
description: 'Pixi environments to setup'
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/upload-artifact/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Upload artifact'
description: 'Generic wrapper for actions/upload-artifact'
description: 'Wrapper for actions/upload-artifact'
inputs:
name:
description: 'Artifact name'
Expand Down Expand Up @@ -38,7 +38,7 @@ runs:
using: 'composite'
steps:
- name: Upload artifact
uses: actions/upload-artifact@v4
uses: actions/upload-artifact@v7
with:
name: ${{ inputs.name }}
path: ${{ inputs.path }}
Expand Down
4 changes: 2 additions & 2 deletions .github/actions/upload-codecov/action.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name: 'Upload coverage to Codecov'
description: 'Generic wrapper for codecov/codecov-action@v5'
description: 'Wrapper for codecov/codecov-action'

inputs:
name:
Expand Down Expand Up @@ -32,7 +32,7 @@ inputs:
runs:
using: composite
steps:
- uses: codecov/codecov-action@v5
- uses: codecov/codecov-action@v6
with:
name: ${{ inputs.name }}
flags: ${{ inputs.flags }}
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/backmerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,19 +20,14 @@ concurrency:
group: backmerge-master-into-develop
cancel-in-progress: false

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
backmerge:
runs-on: ubuntu-latest
timeout-minutes: 10

steps:
- name: Checkout repository (for local actions)
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup easyscience[bot]
id: bot
Expand All @@ -43,7 +38,7 @@ jobs:
repositories: ${{ github.event.repository.name }}

- name: Checkout repository (with bot token)
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
fetch-depth: 0
token: ${{ steps.bot.outputs.token }}
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/cleanup.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@ on:
days:
description: 'Number of days.'
required: true
default: 30
default: '30'
minimum_runs:
description: 'The minimum runs to keep for each workflow.'
required: true
default: 6
default: '6'
delete_workflow_pattern:
description:
'The name or filename of the workflow. if not set then it will target all
Expand Down Expand Up @@ -61,11 +61,6 @@ on:
- 'false'
- 'true'

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
del-runs:
runs-on: ubuntu-latest
Expand Down
159 changes: 126 additions & 33 deletions .github/workflows/issues-labels.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Verifies if an issue has at least one of the `[scope]` and one of the
# `[priority]` labels. If not, the bot adds labels with a warning emoji
# to indicate that those labels need to be added.
# Verifies if the current issue has at least one real `[scope]` label and one
# real `[priority]` label. If either is missing, the workflow adds a reminder
# label with a warning emoji.

name: Issue labels check

Expand All @@ -11,15 +11,8 @@ on:
permissions:
issues: write

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
check-labels:
if: github.actor != 'easyscience[bot]'

runs-on: ubuntu-latest

concurrency:
Expand All @@ -28,29 +21,129 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Setup easyscience[bot]
id: bot
uses: ./.github/actions/setup-easyscience-bot
- name: Sync missing-label reminders
uses: ./.github/actions/github-script
with:
app-id: ${{ vars.EASYSCIENCE_APP_ID }}
private-key: ${{ secrets.EASYSCIENCE_APP_KEY }}
script: |
const fs = require('fs');

- name: Check for required [scope] label
uses: trstringer/require-label-prefix@v1
with:
secret: ${{ steps.bot.outputs.token }}
prefix: '[scope]'
labelSeparator: ' '
addLabel: true
defaultLabel: '[scope] ⚠️ label needed'

- name: Check for required [priority] label
uses: trstringer/require-label-prefix@v1
with:
secret: ${{ steps.bot.outputs.token }}
prefix: '[priority]'
labelSeparator: ' '
addLabel: true
defaultLabel: '[priority] ⚠️ label needed'
const issueNumber = context.issue.number;
const action = context.payload.action;
const changedLabel = context.payload.label?.name ?? null;
const labels = context.payload.issue.labels.map(({ name }) => name);
const requirements = [
{
prefix: '[scope] ',
reminder: '[scope] ⚠️ label needed',
},
{
prefix: '[priority] ',
reminder: '[priority] ⚠️ label needed',
},
];

const labelsToAdd = [];
const labelsToRemove = [];
const evaluations = [];

console.log(`::group::Issue label check for #${issueNumber}`);
console.log(`Event action: ${action}`);
if (changedLabel) {
console.log(`Event label: ${changedLabel}`);
}
console.log(
`Current labels: ${labels.length > 0 ? labels.join(', ') : '(none)'}`,
);

for (const { prefix, reminder } of requirements) {
const matchingRealLabels = labels.filter(
(name) => name.startsWith(prefix) && name !== reminder,
);
const hasRealLabel = matchingRealLabels.length > 0;
const hasReminderLabel = labels.includes(reminder);

evaluations.push({
prefix,
reminder,
matchingRealLabels,
hasReminderLabel,
});

if (hasRealLabel && hasReminderLabel) {
labelsToRemove.push(reminder);
} else if (!hasRealLabel && !hasReminderLabel) {
labelsToAdd.push(reminder);
}
}

for (const evaluation of evaluations) {
if (evaluation.matchingRealLabels.length > 0) {
console.log(
`Found required ${evaluation.prefix}label(s): ${evaluation.matchingRealLabels.join(', ')}`,
);
} else {
console.log(`Missing required ${evaluation.prefix}label.`);
}

if (evaluation.hasReminderLabel) {
console.log(`Reminder label already present: ${evaluation.reminder}`);
}
}

if (labelsToAdd.length > 0) {
console.log(`Adding reminder labels: ${labelsToAdd.join(', ')}`);
await github.rest.issues.addLabels({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
labels: labelsToAdd,
});
}

for (const name of labelsToRemove) {
console.log(`Removing reminder label: ${name}`);
await github.rest.issues.removeLabel({
owner: context.repo.owner,
repo: context.repo.repo,
issue_number: context.issue.number,
name,
});
}

if (labelsToAdd.length === 0 && labelsToRemove.length === 0) {
console.log('No label changes required.');
}

console.log('::endgroup::');

if (process.env.GITHUB_STEP_SUMMARY) {
const summaryLines = [
'### Issue Label Check',
`- Issue: #${issueNumber}`,
`- Event: ${action}`,
`- Trigger label: ${changedLabel ?? '(none)'}`,
`- Current labels: ${labels.length > 0 ? labels.join(', ') : '(none)'}`,
'',
'#### Requirement status',
...evaluations.map((evaluation) => {
const status =
evaluation.matchingRealLabels.length > 0
? `found ${evaluation.matchingRealLabels.join(', ')}`
: 'missing';
const reminder = evaluation.hasReminderLabel
? `reminder present: ${evaluation.reminder}`
: `reminder absent: ${evaluation.reminder}`;
return `- ${evaluation.prefix}: ${status}; ${reminder}`;
}),
'',
`- Labels to add: ${labelsToAdd.length > 0 ? labelsToAdd.join(', ') : '(none)'}`,
`- Labels to remove: ${labelsToRemove.length > 0 ? labelsToRemove.join(', ') : '(none)'}`,
];

fs.appendFileSync(
process.env.GITHUB_STEP_SUMMARY,
`${summaryLines.join('\n')}\n`,
);
}
5 changes: 1 addition & 4 deletions .github/workflows/lint-format.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,14 @@ permissions:
# Set the environment variables to be used in all jobs defined in this workflow
env:
CI_BRANCH: ${{ github.head_ref || github.ref_name }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
lint-format:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6

- name: Set up pixi
uses: ./.github/actions/setup-pixi
Expand Down
9 changes: 2 additions & 7 deletions .github/workflows/release-notes.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,6 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
env:
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
draft-release-notes:
permissions:
Expand All @@ -25,7 +20,7 @@ jobs:

steps:
- name: Checkout repository
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
fetch-depth: 0 # full history with tags to get the version number

Expand Down Expand Up @@ -66,7 +61,7 @@ jobs:
GITHUB_TOKEN: ${{ steps.bot.outputs.token }}

- name: Create GitHub draft release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
with:
draft: true
tag_name: ${{ steps.draft.outputs.tag_name }}
Expand Down
5 changes: 1 addition & 4 deletions .github/workflows/release-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,13 @@ permissions:
env:
DEFAULT_BRANCH: ${{ github.event.repository.default_branch }}
SOURCE_BRANCH: ${{ inputs.source_branch || 'develop' }}
# Opt into Node.js 24 for all JavaScript actions.
# Remove once all referenced actions natively target Node 24.
FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: true

jobs:
create-pull-request:
runs-on: ubuntu-latest
steps:
- name: Checkout ${{ env.SOURCE_BRANCH }} branch
uses: actions/checkout@v5
uses: actions/checkout@v6
with:
ref: ${{ env.SOURCE_BRANCH }}

Expand Down
Loading