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
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: Bug report
about: Create a report to help us improve
title: ''
labels: ''
assignees: ''

---

**Describe the bug**
A clear and concise description of what the bug is.

**To Reproduce**
Steps to reproduce the behavior:

1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
4. See error

**Expected behavior**
A clear and concise description of what you expected to happen.

**Screenshots**
If applicable, add screenshots to help explain your problem.

**Desktop (please complete the following information):**

- OS: [e.g. iOS]
- Browser [e.g. chrome, safari]
- Version [e.g. 22]

**Smartphone (please complete the following information):**

- Device: [e.g. iPhone6]
- OS: [e.g. iOS8.1]
- Browser [e.g. stock browser, safari]
- Version [e.g. 22]

**Additional context**
Add any other context about the problem here.
20 changes: 20 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
---
name: Feature request
about: Suggest an idea for this project
title: ''
labels: ''
assignees: ''

---

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

**Describe the solution you'd like**
A clear and concise description of what you want to happen.

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
27 changes: 27 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<!--
Before you open a pull request please review the following guidelines and tip and edit the relevant sections.
Thank you for contributing!
-->

### Type of Change

<!-- Select - i.e.
- new feature
- bug fix
-->

### Description

<!-- Describe the scope of your change - i.e.
- what the change does how it was tested
- any known limitations
- any tests or examples exercised on your modified code
-->

### Checklist

<!-- [Place an '[X]' (no spaces) in all applicable fields. Please add/remove fields as required.] -->

- [ ] Test code against a test environment and not just on a local cluster
- [ ] Reference relevant issue(s) where applicable and close them after merging
- [ ] Update any documentation and relevant `CHANGELOG.md` files
93 changes: 93 additions & 0 deletions .github/workflows/auto-back-merge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
# SPDX-License-Identifier: Apache-2.0
# © Crown Copyright 2026. This work has been developed by the National Digital Twin Programme and is legally attributed to the Department for Business and Trade (UK) as the governing entity.

# This workflow is triggered when a pull request is merged into the main branch and automatically merges the main branch back into develop to keep it up to date.
# If the merge fails (e.g., due to conflicts), a manual intervention is required. The workflow generates a Job summary of the merge attempt.
name: Auto Back-merge Main to Develop

on:
pull_request:
types:
- closed
branches:
- main

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
merge-main-to-develop:

permissions: {}

name: Back-merge Main to Develop
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest

steps:

- name: Generate Sync Token
id: sync-token
uses: actions/create-github-app-token@bcd2ba49218906704ab6c1aa796996da409d3eb1 # v3.2.0
with:
app-id: ${{ secrets.NODE_NET_REPOSITORY_WRITER_APP_CLIENT_ID }}
private-key: ${{ secrets.NODE_NET_REPOSITORY_WRITER_APP_PRIVATE_KEY }}
permission-contents: write
permission-workflows: write

- name: Merge main into develop and Generate Summary
uses: actions/github-script@3a2844b7e9c422d3c10d287c895573f7108da1b3 # v9.0.0
with:
github-token: ${{ steps.sync-token.outputs.token }}
script: |
const prNumber = context.payload.pull_request.number;
const mergedBy = context.payload.sender.login;
const prUrl = context.payload.pull_request.html_url;

try {
// Attempt to merge main into develop, use the api to ensure the commit
// is gpg signed.
await github.rest.repos.merge({
owner: context.repo.owner,
repo: context.repo.repo,
base: 'develop',
head: 'main',
commit_message: `Merge branch 'main' into 'develop' (#${prNumber})`
});

let summaryText =
Comment on lines +48 to +59
`## Sync Main to Develop ✅

Successfully triggered a merge of \`main\` into \`develop\` following the closure of PR #${prNumber}.

**Original PR Merged by**: @${mergedBy}

[View Original PR](${prUrl})
`;

await core.summary.addRaw(summaryText).write();
} catch (error) {
const finalErrorMessage = error.message || error;
// Write failure summary
summaryText =
`## Sync Main to Develop ❌

Failed to trigger a merge of \`main\` into \`develop\`! This is usually due to a merge conflict. Please resolve it manually by opening a PR from \`main\` to \`develop\`.

### Error Details:

\`\`\`text
${finalErrorMessage}
\`\`\`

**Original PR Merged by**: @${mergedBy}

[View Original PR](${prUrl})
`;

await core.summary.addRaw(summaryText).write();

// Fail the workflow step
core.setFailed(`Merge failed: ${finalErrorMessage}`);
}
Loading
Loading