1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2024-11-16 23:04:50 +00:00

Merge .github directory from master

This commit is contained in:
Jeremy Ruston 2024-09-26 16:31:35 +01:00
parent de15b08b81
commit 459cae2817
4 changed files with 103 additions and 3 deletions

View File

@ -21,7 +21,7 @@ body:
attributes:
label: To Reproduce
description: "Steps to reproduce the behavior:"
value: |
placeholder: |
1. Go to '...'
2. Click on '....'
3. Scroll down to '....'
@ -41,7 +41,7 @@ body:
attributes:
label: TiddlyWiki Configuration
description: please complete the following information
value: |
placeholder: |
- Version [e.g. v5.1.24]
- Saving mechanism [e.g. Node.js, TiddlyDesktop, TiddlyHost etc]
- Plugins installed [e.g. Freelinks, TiddlyMap]

View File

@ -1,7 +1,7 @@
blank_issues_enabled: false
contact_links:
- name: Discuss feature request
url: https://github.com/Jermolene/TiddlyWiki5/discussions
url: https://github.com/TiddlyWiki/TiddlyWiki5/discussions
about: Open new discussion about new feature
- name: Talk.Tiddlywiki Forum
url: https://talk.tiddlywiki.org

30
.github/workflows/cla-check.yml vendored Normal file
View File

@ -0,0 +1,30 @@
name: Check CLA Signature
on:
pull_request_target:
types:
- opened
- reopened
paths-ignore:
- 'licenses/cla-individual.md'
jobs:
check_cla:
runs-on: ubuntu-latest
permissions:
pull-requests: write
if: ${{ (github.event.pull_request.user.login != github.repository_owner) }}
steps:
- run: |
if ! curl -s https://raw.githubusercontent.com/Jermolene/TiddlyWiki5/tiddlywiki-com/licenses/cla-individual.md | grep -io "@$USER,"; then
echo "CLA not signed"
gh pr comment "$NUMBER" -b "@$USER It appears that this is your first contribution to the project, welcome.
With apologies for the bureaucracy, please could you prepare a separate PR to the 'tiddlywiki-com' branch with your signature for the Contributor License Agreement (see [contributing.md](https://github.com/TiddlyWiki/TiddlyWiki5/blob/master/contributing.md))."
else
echo "CLA already signed"
gh pr comment "$NUMBER" -b "Confirmed: **$USER** has already signed the Contributor License Agreement (see [contributing.md](https://github.com/TiddlyWiki/TiddlyWiki5/blob/master/contributing.md))"
fi
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
USER: ${{ github.actor }}

70
.github/workflows/cla-signed.yml vendored Normal file
View File

@ -0,0 +1,70 @@
name: CLA Signed
on:
pull_request_target:
types:
- opened
- closed
paths:
- 'licenses/cla-individual.md'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GH_REPO: ${{ github.repository }}
NUMBER: ${{ github.event.pull_request.number }}
AUTHOR: ${{ github.event.pull_request.user.login }}
jobs:
# check if PRs updating the CLA are targetting the tiddlywiki-com branch
check-signature-branch:
if: (github.event.pull_request.merged != true) && (github.event.pull_request.user.login != github.repository_owner)
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- run: |
if ! $BRANCH == "tiddlywiki-com"; then
echo "This CLA signature targets the wrong branch"
gh pr comment "$NUMBER" -b "@$AUTHOR Signatures to the CLA must target the 'tiddlywiki-com' branch."
fi
env:
BRANCH: ${{ github.event.pull_request.base.ref }}
# leave a comment on each open PR by a given author when their signature is added to the CLA
cla-signed:
if: (github.event.pull_request.merged == true) && (github.event.pull_request.user.login != github.repository_owner)
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: List open PRs by user
id: list-prs
uses: actions/github-script@v6
with:
result-encoding: string
script: |
const owner = context.repo.owner,
repo = context.repo.repo,
author = context.payload.pull_request.user.login;
const { data: pullRequests } = await github.rest.pulls.list({
owner: owner,
repo: repo,
state: 'open',
sort: 'created',
direction: 'desc',
per_page: 100
});
const userPullRequests = pullRequests.filter(pr => pr.user.login === author),
prNumbers = userPullRequests.map(pr => pr.number).join(',');
console.log(`Open pull requests by ${author}:${prNumbers}`);
return prNumbers;
- name: Comment open PRs by the same author
run: |
prs=($(echo ${{ steps.list-prs.outputs.result }} | tr "," "\n"))
for number in "${prs[@]}"
do
gh pr comment "$number" -b "**$AUTHOR** has signed the Contributor License Agreement (see [contributing.md](https://github.com/TiddlyWiki/TiddlyWiki5/blob/master/contributing.md))"
done