-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #11 from SegoCode/develop
Sync from develop to main
- Loading branch information
Showing
24 changed files
with
818 additions
and
292 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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'] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.