From e304f9561eee0df5b4b6ed39852b3e82ad5bef73 Mon Sep 17 00:00:00 2001 From: SegoCode <35817798+SegoCode@users.noreply.github.com> Date: Tue, 13 Aug 2024 11:37:35 +0200 Subject: [PATCH 1/2] Create sync-from-develop-to-main.yml --- .../workflows/sync-from-develop-to-main.yml | 52 +++++++++++++++++++ 1 file changed, 52 insertions(+) create mode 100644 .github/workflows/sync-from-develop-to-main.yml diff --git a/.github/workflows/sync-from-develop-to-main.yml b/.github/workflows/sync-from-develop-to-main.yml new file mode 100644 index 0000000..7baa0b8 --- /dev/null +++ b/.github/workflows/sync-from-develop-to-main.yml @@ -0,0 +1,52 @@ +name: Sync from develop to main + +on: + workflow_dispatch: + +jobs: + create_pr: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v2 + + - name: Setup git + run: | + git config --global user.name "github-actions" + git config --global user.email "github-actions@github.com" + + - name: Install GitHub CLI + run: | + sudo apt-get update + sudo apt-get install gh -y + + - name: Check and create labels + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Check if the 'auto-sync' label exists + AUTO_SYNC_LABEL=$(gh api repos/${{ github.repository }}/labels --jq '.[] | select(.name=="auto-sync")') + if [ -z "$AUTO_SYNC_LABEL" ]; then + # Create the 'auto-sync' label if it doesn't exist + gh api repos/${{ github.repository }}/labels -f name='auto-sync' -f color='C5DEF5' + fi + + # Check if the 'auto-tag' label exists + AUTO_TAG_LABEL=$(gh api repos/${{ github.repository }}/labels --jq '.[] | select(.name=="auto-tag")') + if [ -z "$AUTO_TAG_LABEL" ]; then + # Create the 'auto-tag' label if it doesn't exist + gh api repos/${{ github.repository }}/labels -f name='auto-tag' -f color='BFDADC' + fi + + - name: Create pull request + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + # Create the pull request + PR_URL=$(gh pr create --base main --head develop --title "Sync from develop to main" --body $'This is an automated pull request to sync changes from the develop branch to the main branch. \n >[!WARNING]\n> If this pull request is merged with the \'**auto-tag**\' label, it will create a **new tag**. To prevent this, manually remove the \'**auto-tag**\' label.') + + # Extract PR number from URL + PR_NUMBER=$(basename $PR_URL) + + # Add the labels to the pull request + gh pr edit $PR_NUMBER --add-label "auto-sync" --add-label "auto-tag" From 33a1391626ce39824eda5b3fa70d71006cb74f56 Mon Sep 17 00:00:00 2001 From: github-actions Date: Tue, 13 Aug 2024 09:40:25 +0000 Subject: [PATCH 2/2] Initialize repository with repo name and username --- .github/FUNDING.yml | 2 +- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- .github/ISSUE_TEMPLATE/feature_request.yml | 2 +- .github/SECURITY.md | 2 +- .github/workflows/initializer.yml | 71 ---------------------- LICENSE | 2 +- 7 files changed, 6 insertions(+), 77 deletions(-) delete mode 100644 .github/workflows/initializer.yml diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml index 5c41eff..df40ac8 100644 --- a/.github/FUNDING.yml +++ b/.github/FUNDING.yml @@ -1,4 +1,4 @@ -github: [{username}] +github: [SegoCode] 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 diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index e6219c9..23da96b 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -57,7 +57,7 @@ body: attributes: label: Confirmation options: - - label: I performed a [search of the issue tracker](https://github.com/{username}/{reponame}/issues) to avoid opening a duplicate issue + - label: I performed a [search of the issue tracker](https://github.com/SegoCode/DebloBat/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 diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 7f83253..b242a1b 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -1,5 +1,5 @@ blank_issues_enabled: false contact_links: - name: Contact the developer - url: https://{username}.github.io/{username}/ + url: https://SegoCode.github.io/SegoCode/ about: To discuss any type of related topic diff --git a/.github/ISSUE_TEMPLATE/feature_request.yml b/.github/ISSUE_TEMPLATE/feature_request.yml index 23c5ebc..418bf58 100644 --- a/.github/ISSUE_TEMPLATE/feature_request.yml +++ b/.github/ISSUE_TEMPLATE/feature_request.yml @@ -34,7 +34,7 @@ body: attributes: label: Confirmation options: - - label: I performed a [search of the feature requests](https://github.com/{username}/{reponame}/issues) to avoid suggesting a duplicate feature + - label: I performed a [search of the feature requests](https://github.com/SegoCode/DebloBat/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 diff --git a/.github/SECURITY.md b/.github/SECURITY.md index df34996..0d89241 100644 --- a/.github/SECURITY.md +++ b/.github/SECURITY.md @@ -1 +1 @@ -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. +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. diff --git a/.github/workflows/initializer.yml b/.github/workflows/initializer.yml deleted file mode 100644 index 881756d..0000000 --- a/.github/workflows/initializer.yml +++ /dev/null @@ -1,71 +0,0 @@ -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 "github-actions@github.com" - - - 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" diff --git a/LICENSE b/LICENSE index dde1197..43ad7db 100644 --- a/LICENSE +++ b/LICENSE @@ -1,4 +1,4 @@ -Copyright (c) {username} +Copyright (c) SegoCode All rights reserved. Section 1 - Definitions