Skip to content

Commit

Permalink
Merge pull request #11 from SegoCode/develop
Browse files Browse the repository at this point in the history
Sync from develop to main
  • Loading branch information
SegoCode authored Aug 13, 2024
2 parents e304f95 + 7e8de4c commit 2152c32
Show file tree
Hide file tree
Showing 24 changed files with 818 additions and 292 deletions.
3 changes: 3 additions & 0 deletions .github/CODE_OF_CONDUCT.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
This project adheres to **No Code of Conduct**. We are all adults. We accept anyone's contributions. Nothing else matters.

For more information please visit the [No Code of Conduct](https://github.com/domgetter/NCoC) homepage.
11 changes: 11 additions & 0 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
github: [{username}]
community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
issuehunt: # Replace with a single IssueHunt username
ko_fi: # Replace with a single ko_fi username
liberapay: # Replace with a single Liberapay username
open_collective: # Replace with a single open_collective username
patreon: # Replace with a single Patreon username
tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
polar: # Replace with a single polar username
buy_me_a_coffee: # Replace with a single buy_me_a_coffee username
custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
11 changes: 6 additions & 5 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -42,21 +42,22 @@ body:

- type: dropdown
attributes:
label: SO version
label: OS version
options:
- Windows 11
- Windows 10
- Windows 8
- Windows 7
- Other
- Windows Other
- Linux Debian
- Linux Arch
- Linux Other
validations:
required: true

- type: checkboxes
attributes:
label: Confirmation
options:
- label: I performed a [search of the issue tracker](https://github.com/segocode/DebloBat/issues) to avoid opening a duplicate issue
- label: I performed a [search of the issue tracker](https://github.com/{username}/{reponame}/issues) to avoid opening a duplicate issue
required: true
- label: I understand that not filling out this template correctly may lead to the issue being closed
required: true
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/config.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
blank_issues_enabled: false
contact_links:
- name: Contact the developer
url: https://segocode.github.io/SegoCode/
url: https://{username}.github.io/{username}/
about: To discuss any type of related topic
4 changes: 2 additions & 2 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ body:
attributes:
label: Confirmation
options:
- label: I performed a [search of the feature requests](https://github.com/segocode/DebloBat/issues) to avoid suggesting a duplicate feature
- label: I performed a [search of the feature requests](https://github.com/{username}/{reponame}/issues) to avoid suggesting a duplicate feature
required: true
- label: I understand that not filling out this template correctly may lead to the request being closed
required: true
required: true
5 changes: 1 addition & 4 deletions .github/SECURITY.md
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
## Security Policy

### Reporting a Vulnerability
If you discover a vulnerability in this application, that poses a significant threat to the security of the users, we recommend that you do not open a public issue. Instead, please send your report via [email](https://segocode.github.io/SegoCode/). Include as much detailed information as possible to help understand the nature of the vulnerability.
If you discover a vulnerability in this application, that poses a significant threat to the security of the users, we recommend that you do not open a public issue. Instead, please send your report via [email](https://{username}.github.io/{username}/). Include as much detailed information as possible to help understand the nature of the vulnerability.
94 changes: 94 additions & 0 deletions .github/workflows/generate-tag.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
name: Generate tag

on:
pull_request:
types: [closed]

jobs:
create_tag:
if: github.event.pull_request.merged == true && contains(github.event.pull_request.labels.*.name, 'auto-tag')
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up git
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
- name: Fetch all tags
run: git fetch --tags

- name: Get latest tag
id: get_latest_tag
run: |
# Get the latest tag
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null || echo "")
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
- name: Determine new version
id: determine_version
run: |
latest_tag=${{ env.latest_tag }}
if [ -z "$latest_tag" ]; then
# Initialize the version to 1.0 if no tags exist
new_version="1.0"
else
# Extract the major and minor version and increment the minor version
major_version=$(echo $latest_tag | cut -d. -f1)
minor_version=$(echo $latest_tag | cut -d. -f2)
new_minor_version=$((minor_version + 1))
new_version="$major_version.$new_minor_version"
# Check if the new version tag already exists
while git rev-parse "refs/tags/$new_version" >/dev/null 2>&1; do
new_minor_version=$((new_minor_version + 1))
new_version="$major_version.$new_minor_version"
done
fi
echo "new_version=$new_version" >> $GITHUB_ENV
- name: Checkout main branch
run: |
git checkout main
- name: Create new tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
new_version=${{ env.new_version }}
git tag -a $new_version -m "Automatically generated version $new_version"
git push origin $new_version
create_issue:
needs: tag_version
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up git
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
- name: Fetch all tags
run: git fetch --tags

- name: Get the latest tag
id: get_latest_tag
run: |
# Get the latest tag
latest_tag=$(git describe --tags `git rev-list --tags --max-count=1` 2>/dev/null || echo "")
echo "latest_tag=$latest_tag" >> $GITHUB_ENV
- name: Create issue for new tag
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
latest_tag: ${{ env.latest_tag }}
run: |
repository=${{ github.repository }}
issue_title="The tag \`${{ env.latest_tag }}\` was created"
issue_body=$'The **${{ env.latest_tag }}** tag for the **main branch** has been created. Please consider creating a release of this tag, if a release isn\'t needed, you can close this issue.\n\n[Click here to create a release of **${{ env.latest_tag }}** tag](../releases/new?tag=${{ env.latest_tag }})'
gh issue create --title "$issue_title" --body "$issue_body" --label "auto-tag"
15 changes: 15 additions & 0 deletions .github/workflows/gitleaks.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
name: Gitleaks
on: [pull_request, push, workflow_dispatch]
jobs:
scan:
name: gitleaks
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Run Gitleaks
uses: gitleaks/gitleaks-action@v2
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
5 changes: 3 additions & 2 deletions .github/workflows/greetings.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
name: Greetings

on: [pull_request_target]
on: [pull_request_target, issues]

jobs:
greeting:
Expand All @@ -12,4 +12,5 @@ jobs:
- uses: actions/first-interaction@v1
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
pr-message: "🎉 Thank you for your first pull request to the repository! We're grateful for your contribution and will review it ASAP."
issue-message: "Thank you for your first issue. To better understand your request or the problem you've encountered, please provide as many details as possible. If the behavior changes or if you have new information about your request, don't hesitate to add it. It will be reviewed ASAP."
pr-message: "Thank you for your first pull request to the repository! We're grateful for your contribution and will review it ASAP."
71 changes: 71 additions & 0 deletions .github/workflows/initializer.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
name: Initialize repository

on:
workflow_dispatch:

jobs:
initialize_repo:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0

- name: Setup git
run: |
git config --global user.name "github-actions"
git config --global user.email "[email protected]"
- name: Install GitHub CLI
run: |
sudo apt-get update
sudo apt-get install gh -y
- name: Extract repository and username
id: extract
run: |
REPO_NAME="${{ github.repository }}"
USERNAME=$(echo $REPO_NAME | cut -d'/' -f1)
REPO_NAME_ONLY=$(echo $REPO_NAME | cut -d'/' -f2)
echo "::set-output name=username::$USERNAME"
echo "::set-output name=reponame::$REPO_NAME_ONLY"
- name: Set branch name
id: vars
run: echo "::set-output name=branch::initialize-repo-$(date +%Y%m%d%H%M%S)"

- name: Replace {reponame} and {username} with actual values
run: |
REPO_NAME_ONLY="${{ steps.extract.outputs.reponame }}"
USERNAME="${{ steps.extract.outputs.username }}"
REPO_NAME_ESCAPED=$(echo $REPO_NAME_ONLY | sed 's/\//\\\//g')
USERNAME_ESCAPED=$(echo $USERNAME | sed 's/\//\\\//g')
find . -type f -exec sed -i "s/{reponame}/$REPO_NAME_ESCAPED/g" {} +
find . -type f -exec sed -i "s/{username}/$USERNAME_ESCAPED/g" {} +
- name: Remove initializer workflow
run: |
rm -f .github/workflows/initializer.yml
- name: Commit changes
run: |
BRANCH_NAME="${{ steps.vars.outputs.branch }}"
git checkout -b $BRANCH_NAME
git add .
git commit -m "Initialize repository with repo name $REPO_NAME_ONLY and username $USERNAME"
git push origin HEAD:$BRANCH_NAME
- name: Create pull request
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
BRANCH_NAME="${{ steps.vars.outputs.branch }}"
PR_URL=$(gh pr create --base main --head $BRANCH_NAME --title "Initialize repository" --body "This PR initializes the repository with the actual repository name, with the actual username and removing the initializer workflow.")
# Extract PR number from URL
PR_NUMBER=$(basename $PR_URL)
# Add any desired labels to the pull request
# gh pr edit $PR_NUMBER --add-label "initialization"
105 changes: 102 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Created by https://www.toptal.com/developers/gitignore/api/intellij+all,visualstudiocode,git,windows,linux
# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+all,visualstudiocode,git,windows,linux
# Created by https://www.toptal.com/developers/gitignore/api/git,gpg,ssh,vim,linux,macos,windows,notepadpp,sublimetext,intellij+all,visualstudiocode
# Edit at https://www.toptal.com/developers/gitignore?templates=git,gpg,ssh,vim,linux,macos,windows,notepadpp,sublimetext,intellij+all,visualstudiocode

### Git ###
# Created by git for backups. To disable backups in Git:
Expand All @@ -16,6 +16,10 @@
*_LOCAL_*.txt
*_REMOTE_*.txt

### GPG ###
secring.*


### Intellij+all ###
# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider
# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839
Expand Down Expand Up @@ -119,6 +123,101 @@ fabric.properties
# .nfs files are created when an open file is removed but is still being accessed
.nfs*

### macOS ###
# General
.DS_Store
.AppleDouble
.LSOverride

# Icon must end with two \r
Icon


# Thumbnails
._*

# Files that might appear in the root of a volume
.DocumentRevisions-V100
.fseventsd
.Spotlight-V100
.TemporaryItems
.Trashes
.VolumeIcon.icns
.com.apple.timemachine.donotpresent

# Directories potentially created on remote AFP share
.AppleDB
.AppleDesktop
Network Trash Folder
Temporary Items
.apdisk

### macOS Patch ###
# iCloud generated files
*.icloud

### NotepadPP ###
# Notepad++ backups #
*.bak

### SSH ###
**/.ssh/id_*
**/.ssh/*_id_*
**/.ssh/known_hosts

### SublimeText ###
# Cache files for Sublime Text
*.tmlanguage.cache
*.tmPreferences.cache
*.stTheme.cache

# Workspace files are user-specific
*.sublime-workspace

# Project files should be checked into the repository, unless a significant
# proportion of contributors will probably not be using Sublime Text
# *.sublime-project

# SFTP configuration file
sftp-config.json
sftp-config-alt*.json

# Package control specific files
Package Control.last-run
Package Control.ca-list
Package Control.ca-bundle
Package Control.system-ca-bundle
Package Control.cache/
Package Control.ca-certs/
Package Control.merged-ca-bundle
Package Control.user-ca-bundle
oscrypto-ca-bundle.crt
bh_unicode_properties.cache

# Sublime-github package stores a github token in this file
# https://packagecontrol.io/packages/sublime-github
GitHub.sublime-settings

### Vim ###
# Swap
[._]*.s[a-v][a-z]
!*.svg # comment out if you don't need vector files
[._]*.sw[a-p]
[._]s[a-rt-v][a-z]
[._]ss[a-gi-z]
[._]sw[a-p]

# Session
Session.vim
Sessionx.vim

# Temporary
.netrwhist
# Auto-generated tag files
tags
# Persistent undo
[._]*.un~

### VisualStudioCode ###
.vscode/*
!.vscode/settings.json
Expand Down Expand Up @@ -164,4 +263,4 @@ $RECYCLE.BIN/
# Windows shortcuts
*.lnk

# End of https://www.toptal.com/developers/gitignore/api/intellij+all,visualstudiocode,git,windows,linux
# End of https://www.toptal.com/developers/gitignore/api/git,gpg,ssh,vim,linux,macos,windows,notepadpp,sublimetext,intellij+all,visualstudiocode
Loading

0 comments on commit 2152c32

Please sign in to comment.