mirror of
https://github.com/DuendeSoftware/products
synced 2026-05-24 09:28:24 +00:00
Re-inistate workflow and contributing.md
This commit is contained in:
parent
2d947f263f
commit
f73fbebaf9
2 changed files with 126 additions and 0 deletions
33
.github/CONTRIBUTING.md
vendored
Normal file
33
.github/CONTRIBUTING.md
vendored
Normal file
|
|
@ -0,0 +1,33 @@
|
|||
# Contributing to Duende Software Products
|
||||
|
||||
Thank you for your interest in Duende Software. As this repository contains proprietary licensed software, we have a specific policy regarding contributions.
|
||||
|
||||
**We do not generally accept unsolicited contributions to this repository.**
|
||||
|
||||
## How to Report Issues or Suggest Improvements
|
||||
|
||||
If you've identified an issue, have a suggestion, or want to discuss any aspect of our products:
|
||||
|
||||
1. Please use the [GitHub Discussions](https://github.com/orgs/DuendeSoftware/discussions) for the Duende Software organization.
|
||||
2. Provide a clear description of your observation, suggestion, or question.
|
||||
3. Our team will review and respond to appropriate discussion threads.
|
||||
|
||||
## Limited Contribution Scenarios
|
||||
|
||||
In specific cases where a contribution might be considered:
|
||||
|
||||
1. Only proceed after explicit invitation or approval from the Duende Software team.
|
||||
2. Any contributed code must be compatible with our proprietary license.
|
||||
3. You will be required to sign a Contributor License Agreement (CLA) before any contribution can be accepted.
|
||||
|
||||
## Code of Conduct
|
||||
|
||||
When participating in discussions related to Duende Software:
|
||||
|
||||
- Be respectful and professional in all communications
|
||||
- Focus on technical details and specific product functionality
|
||||
- Understand that not all suggestions will be implemented
|
||||
|
||||
## Thank You
|
||||
|
||||
We appreciate your understanding of our contribution policy. Our team works diligently to ensure the quality and integrity of our products, and we value your interest and feedback through the appropriate channels.
|
||||
93
.github/workflows/auto-close-external.yml
vendored
Normal file
93
.github/workflows/auto-close-external.yml
vendored
Normal file
|
|
@ -0,0 +1,93 @@
|
|||
name: github/auto-close-external
|
||||
|
||||
on:
|
||||
issues:
|
||||
types: [opened]
|
||||
pull_request_target:
|
||||
types: [opened]
|
||||
workflow_dispatch:
|
||||
inputs:
|
||||
dry-run:
|
||||
description: 'Log what would be closed without actually closing'
|
||||
type: boolean
|
||||
default: true
|
||||
|
||||
permissions:
|
||||
issues: write
|
||||
pull-requests: write
|
||||
|
||||
jobs:
|
||||
close-external:
|
||||
# Only run on the public 'products' repo, not 'products-private'
|
||||
if: github.repository == 'DuendeSoftware/products'
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/github-script@v7
|
||||
with:
|
||||
script: |
|
||||
const isIssue = context.eventName === 'issues';
|
||||
const isPR = context.eventName === 'pull_request_target';
|
||||
const isManual = context.eventName === 'workflow_dispatch';
|
||||
const dryRun = isManual && context.payload.inputs['dry-run'] === 'true';
|
||||
|
||||
const { owner, repo } = context.repo;
|
||||
const exempt = ['OWNER', 'MEMBER', 'COLLABORATOR'];
|
||||
|
||||
function buildComment(itemType) {
|
||||
return [
|
||||
`Thank you for your interest in Duende Software!`,
|
||||
``,
|
||||
`This repository contains proprietary licensed software and does not accept unsolicited issues or pull requests. This ${itemType} has been automatically closed.`,
|
||||
``,
|
||||
`- Please review our [contributor guidelines](https://github.com/DuendeSoftware/products/blob/main/.github/CONTRIBUTING.md) for more details.`,
|
||||
`- For questions, bug reports, or suggestions, please use [GitHub Discussions](https://github.com/orgs/DuendeSoftware/discussions).`,
|
||||
``,
|
||||
`We appreciate your understanding!`,
|
||||
].join('\n');
|
||||
}
|
||||
|
||||
async function closeItem(number, association, itemType) {
|
||||
if (exempt.includes(association)) {
|
||||
console.log(`Skipping #${number} - author_association is ${association}`);
|
||||
return;
|
||||
}
|
||||
|
||||
if (dryRun) {
|
||||
console.log(`[DRY RUN] Would close ${itemType} #${number} (author_association: ${association})`);
|
||||
return;
|
||||
}
|
||||
|
||||
await github.rest.issues.createComment({
|
||||
owner, repo, issue_number: number, body: buildComment(itemType),
|
||||
});
|
||||
|
||||
if (itemType === 'issue') {
|
||||
await github.rest.issues.update({
|
||||
owner, repo, issue_number: number, state: 'closed', state_reason: 'not_planned',
|
||||
});
|
||||
} else {
|
||||
await github.rest.pulls.update({
|
||||
owner, repo, pull_number: number, state: 'closed',
|
||||
});
|
||||
}
|
||||
|
||||
console.log(`Closed ${itemType} #${number} (author_association: ${association})`);
|
||||
}
|
||||
|
||||
if (isManual) {
|
||||
// Process all open issues
|
||||
for await (const response of github.paginate.iterator(
|
||||
github.rest.issues.listForRepo, { owner, repo, state: 'open', per_page: 100 }
|
||||
)) {
|
||||
for (const item of response.data) {
|
||||
const itemType = item.pull_request ? 'pull request' : 'issue';
|
||||
await closeItem(item.number, item.author_association, itemType);
|
||||
}
|
||||
}
|
||||
} else if (isIssue) {
|
||||
const item = context.payload.issue;
|
||||
await closeItem(item.number, item.author_association, 'issue');
|
||||
} else if (isPR) {
|
||||
const item = context.payload.pull_request;
|
||||
await closeItem(item.number, item.author_association, 'pull request');
|
||||
}
|
||||
Loading…
Reference in a new issue