Skip to content

Commit 45d1985

Browse files
authored
Merge pull request #148 from ecmwf-actions/fix/raw-escape-nunjucks
Fix file-sync errors in raw blocks and add labelling actions
2 parents c8ef029 + 6083c21 commit 45d1985

11 files changed

+137
-16
lines changed

sync-files/anemoi/.github/labeler.yml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
dependencies:
2+
- changed-files:
3+
- any-glob-to-any-file:
4+
- "requirements.txt"
5+
- "setup.py"
6+
- "pyproject.toml"
7+
- "Pipfile"
8+
- "Pipfile.lock"
9+
- "requirements/*.txt"
10+
- "requirements/*.in"
11+
12+
documentation:
13+
- changed-files:
14+
- any-glob-to-any-file:
15+
- "docs/**/*"
16+
- "*.md"
17+
- "*.rst"
18+
19+
config:
20+
- changed-files:
21+
- any-glob-to-any-file:
22+
- ".pre-commit-config.yaml"
23+
- "config/**/*"
24+
- "settings/**/*"
25+
- "*.ini"
26+
- "*.cfg"
27+
- "*.conf"
28+
29+
CI/CD:
30+
- changed-files:
31+
- any-glob-to-any-file:
32+
- ".github/**/*"
33+
- "tox.ini"
34+
- ".coveragerc"

sync-files/anemoi/.github/release.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# .github/release.yml
2+
# https://docs.github.com/en/repositories/releasing-projects-on-github/automatically-generated-release-notes
3+
4+
changelog:
5+
exclude:
6+
labels:
7+
- ignore-for-release
8+
- no-changelog
9+
authors:
10+
- pre-commit-ci
11+
categories:
12+
- title: Breaking Changes 🛠
13+
labels:
14+
- "breaking change"
15+
- title: Exciting New Features 🎉
16+
labels:
17+
- enhancement
18+
- title: Config Changes 📑
19+
labels:
20+
- config
21+
- title: Other Changes 🔗
22+
labels:
23+
- "*"

sync-files/anemoi/.github/workflows/downstream-ci-hpc.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: ci
1+
name: Test downstream dependent packages on HPC
22

33
on:
44
# Trigger the workflow on push to main or develop, except tag creation
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: "Pull Request Labeler Conventional Commits"
2+
3+
on:
4+
pull_request:
5+
branches: [main]
6+
types:
7+
[opened, reopened, labeled, unlabeled]
8+
9+
jobs:
10+
assign-labels:
11+
runs-on: ubuntu-latest
12+
name: Assign labels in pull request
13+
if: github.event.pull_request.merged == false
14+
steps:
15+
- uses: actions/checkout@v3
16+
- name: Assign labels from Conventional Commits
17+
id: action-assign-labels
18+
uses: mauroalderete/action-assign-labels@v1
19+
with:
20+
pull-request-number: {% raw %}${{ github.event.pull_request.number }}{% endraw %}
21+
github-token: {% raw %}${{ secrets.GITHUB_TOKEN }}{% endraw %}
22+
conventional-commits: |
23+
conventional-commits:
24+
- type: 'fix'
25+
nouns: ['FIX', 'Fix', 'fix', 'FIXED', 'Fixed', 'fixed']
26+
labels: ['bug']
27+
- type: 'feature'
28+
nouns: ['FEATURE', 'Feature', 'feature', 'FEAT', 'Feat', 'feat']
29+
labels: ['enhancement']
30+
- type: 'breaking_change'
31+
nouns: ['BREAKING CHANGE', 'BREAKING', 'MAJOR']
32+
labels: ['breaking change']
33+
- type: 'documentation'
34+
nouns: ['doc','docs','docu','document','documentation']
35+
labels: ['documentation']
36+
- type: 'build'
37+
nouns: ['build','rebuild','ci']
38+
labels: ['CI/CD']
39+
- type: 'config'
40+
nouns: ['config', 'conf', 'cofiguration']
41+
labels: ['config']
42+
maintain-labels-not-matched: false
43+
apply-changes: true
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
name: "Pull Request Labeler File-based"
2+
on:
3+
- pull_request_target
4+
5+
jobs:
6+
labeler:
7+
permissions:
8+
contents: read
9+
pull-requests: write
10+
runs-on: ubuntu-latest
11+
steps:
12+
- name: Assign labels from file changes
13+
- uses: actions/labeler@v5

sync-files/anemoi/.github/workflows/label-public-pr.yml renamed to sync-files/anemoi/.github/workflows/pr-label-public.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
# Manage labels of pull requests that originate from forks
2-
name: label-public-pr
2+
name: Label PRs from public forks
33

44
on:
55
pull_request_target:

sync-files/anemoi/.github/workflows/push-to-private.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% raw %}name: Push to private repository
1+
name: Push to private repository
22

33
on:
44
push:
@@ -7,7 +7,7 @@ on:
77

88
jobs:
99
push_changes:
10-
if: ${{ !contains(github.repository, 'private') }}{% endraw %}
10+
if: {% raw %}${{ !contains(github.repository, 'private') }}{% endraw %}
1111
runs-on: ubuntu-latest
1212

1313
steps:
@@ -25,10 +25,10 @@ jobs:
2525
- name: Setup SSH key
2626
uses: webfactory/[email protected]
2727
with:
28-
ssh-private-key: ${{ secrets.KEY_TO_PRIVATE }}
28+
ssh-private-key: {% raw %}${{ secrets.KEY_TO_PRIVATE }}{% endraw %}
2929

3030
- name: Push changes to private repository
3131
run: |
32-
git remote add private [email protected]:${{ github.repository }}-private.git
32+
git remote add private [email protected]:{% raw %}${{ github.repository }}{% endraw %}-private.git
3333
git push --set-upstream private main
34-
{% endraw %}
34+

sync-files/anemoi/.github/workflows/python-publish.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# This workflow will upload a Python Package using Twine when a release is created
33
# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries
44

5-
name: Upload Python Package
5+
name: Upload Python Package to PyPI
66

77
on:
88
release:

sync-files/anemoi/.github/workflows/python-pull-request.yml

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% raw %}name: Code Quality checks for PRs
1+
name: Code Quality checks and Testing
22

33
on:
44
pull_request:
@@ -21,5 +21,4 @@ jobs:
2121
python-version: ["3.9", "3.10", "3.11", "3.12"]
2222
uses: ecmwf-actions/reusable-workflows/.github/workflows/qa-pytest-pyproject.yml@v2
2323
with:
24-
python-version: ${{ matrix.python-version }}
25-
{% endraw %}
24+
python-version: {% raw %}${{ matrix.python-version }}{% endraw %}

sync-files/anemoi/.github/workflows/release-please.yml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
{% raw %}name: Run Release Please
1+
name: Run Release Please
22
on:
33
push:
44
branches:
@@ -18,9 +18,8 @@ jobs:
1818
# this assumes that you have created a personal access token
1919
# (PAT) and configured it as a GitHub action secret named
2020
# `MY_RELEASE_PLEASE_TOKEN` (this secret name is not important).
21-
token: ${{ secrets.RELEASE_PLEASE_TOKEN }}
21+
token: {% raw %}${{ secrets.RELEASE_PLEASE_TOKEN }}{% endraw %}
2222
# optional. customize path to .release-please-config.json
2323
config-file: .release-please-config.json
2424
# Currently releases are done from main
25-
target-branch: ${{ github.ref_name }}
26-
{% endraw %}
25+
target-branch: {% raw %}${{ github.ref_name }}{% endraw %}

sync-files/sync.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,18 @@ group:
151151
dest: .gitignore
152152
- source: sync-files/general/python/.github/dependabot.yml
153153
dest: .github/dependabot.yml
154-
- source: sync-files/anemoi/.github/workflows/label-public-pr.yml
154+
- source: sync-files/anemoi/.github/workflows/pr-label-public.yml
155155
dest: .github/workflows/label-public-pr.yml
156+
template:
157+
repo_name: anemoi-core
158+
- source: sync-files/anemoi/.github/workflows/pr-label-conventional-commit.yml
159+
dest: .github/workflows/pr-label-conventional-commit.yml
160+
template:
161+
repo_name: anemoi-core
162+
- source: sync-files/anemoi/.github/workflows/pr-label-file-based.yml
163+
dest: .github/workflows/pr-label-file-based.yml
164+
template:
165+
repo_name: anemoi-core
156166
- source: sync-files/anemoi/.github/workflows/pr-conventional-commit.yml
157167
dest: .github/workflows/pr-conventional-commit.yml
158168
template:

0 commit comments

Comments
 (0)