Skip to content

Commit 99d3ac4

Browse files
committed
Pipeline updates for Pull Requests
1 parent 7f06e04 commit 99d3ac4

6 files changed

Lines changed: 166 additions & 0 deletions

File tree

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Hotfix candidate
3+
about: Create a new hotfix candidate issue
4+
title: "[hotfix] hf/vx.x.x"
5+
labels: hotfix
6+
assignees: ''
7+
8+
---
9+
10+
Please check that your version number is correct in the title.
11+
Shortly a comment below will appear with the branch and PR for the new hotfix candidate
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
name: Release candidate
3+
about: Create a new release candidate issue
4+
title: "[release] rc/vx.x.x"
5+
labels: release
6+
assignees: ''
7+
8+
---
9+
10+
Please check that your version number is correct in the title.
11+
Shortly a comment below will appear with the branch and PR for the new release candidate
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Hotfix checklist
2+
3+
- [ ] Bumped minor version number on both DESCRIPTION and NEWS.md
4+
5+
- [ ] Build passes pipeline checks
6+
7+
- [ ] The new changes do not affect the API
8+
9+
- [ ] The new changes do not affect the documentation (including screenshots)
10+
11+
- [ ] The new changes do not impact the QC report
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
# Critical checks
2+
3+
- [ ] Is the version number correct?
4+
5+
- [ ] DESCRIPTION file
6+
7+
- [ ] [NEWS.md](http://news.md/)
8+
9+
- [ ] Does the build pass?
10+
11+
---
12+
13+
## Documentation
14+
15+
Does it include the following sections?
16+
17+
- [ ] Module introduction with features
18+
19+
- [ ] (O) Screenshots
20+
21+
- [ ] Installation details
22+
23+
- [ ] Explanation of function arguments
24+
25+
- [ ] Data specifications and requirements
26+
27+
- [ ] Different possible visualizations
28+
29+
- [ ] Are the changes/new features included in [NEWS.md?](http://news.md/)
30+
31+
- [ ] (O) Screenshots
32+
33+
- [ ] (O) Explanation of input menus
34+
35+
- [ ] (O) Short articles on building the app, compatibility with other modules, known bugs,...
36+
37+
---
38+
39+
## QC Report
40+
41+
- [ ] Does it include a QC Report?
42+
43+
---
44+
45+
## API conventions
46+
47+
- [ ] Follows API convention

.github/workflows/hotfix_pr.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Create a PR link for hotfix issues
2+
on:
3+
issues:
4+
types: [opened, labeled, edited]
5+
6+
jobs:
7+
create-pr:
8+
if: contains(github.event.issue.labels.*.name, 'hotfix') # This ensures the job only runs if the 'hotfix' label is present
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Create PR link and post in comment
18+
id: pr-link-creation
19+
env:
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
ISSUE: ${{ github.event.issue.html_url }}
22+
run: |
23+
version=$(echo "${{ github.event.issue.title }}" | sed -n 's/.*rc\/\(v[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p')
24+
25+
# Early return if issue name is not correct
26+
if [ -z "$version" ]; then
27+
gh issue comment ${{ github.event.issue.number }} --body "Version number is not present or incorrect."
28+
exit 1
29+
fi
30+
31+
branch_name="hf/$version"
32+
33+
branch_text="Expected branch name: \`$branch_name\`"
34+
35+
echo "Creating PR link"
36+
title=$(echo ${{ github.event.issue.title }} | jq -sRr @uri)hotfix
37+
pr_url_text="https://github.com/${{github.repository}}/compare/main...${branch_name}?quick_pull=1&template=hotfix_pull_request_template.md&title=${title}&labels=hotfix"
38+
body_url="PR Link: [pull request](<${pr_url_text}>)."
39+
40+
body="$branch_text $body_url"
41+
42+
echo "Creating comment"
43+
gh issue comment ${{ github.event.issue.number }} --body "$body"

.github/workflows/release_pr.yml

Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: Create a PR link for release issues
2+
on:
3+
issues:
4+
types: [opened, labeled, edited]
5+
6+
jobs:
7+
create-pr:
8+
if: contains(github.event.issue.labels.*.name, 'release') # This ensures the job only runs if the 'release' label is present
9+
runs-on: ubuntu-latest
10+
permissions:
11+
issues: write
12+
13+
steps:
14+
- name: Checkout repository
15+
uses: actions/checkout@v4
16+
17+
- name: Create PR link and post in comment
18+
id: pr-link-creation
19+
env:
20+
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
21+
ISSUE: ${{ github.event.issue.html_url }}
22+
run: |
23+
version=$(echo "${{ github.event.issue.title }}" | sed -n 's/.*rc\/\(v[0-9]\+\.[0-9]\+\.[0-9]\+\).*/\1/p')
24+
25+
# Early return if issue name is not correct
26+
if [ -z "$version" ]; then
27+
gh issue comment ${{ github.event.issue.number }} --body "Version number is not present or incorrect."
28+
exit 1
29+
fi
30+
31+
branch_name="rc/$version"
32+
33+
branch_text="Expected branch name: \`$branch_name\`"
34+
35+
echo "Creating PR link"
36+
title=$(echo ${{ github.event.issue.title }} | jq -sRr @uri)hotfix
37+
pr_url_text="https://github.com/${{github.repository}}/compare/main...${branch_name}?quick_pull=1&template=release_pull_request_template.md&title=${title}&labels=hotfix"
38+
body_url="PR Link: [pull request](<${pr_url_text}>)."
39+
40+
body="$branch_text $body_url"
41+
42+
echo "Creating comment"
43+
gh issue comment ${{ github.event.issue.number }} --body "$body"

0 commit comments

Comments
 (0)