-
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 #3 from Falcion/development
chores(git): update shields in README and add new
- Loading branch information
Showing
4 changed files
with
86 additions
and
3 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,38 @@ | ||
name: Checker of release tags | ||
|
||
on: | ||
release: | ||
types: | ||
- created | ||
|
||
jobs: | ||
check-release-tag: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Check tag prefixes | ||
run: | | ||
# Extract the tag name from the event payload | ||
TAG_NAME=$(jq -r '.release.tag_name' "$GITHUB_EVENT_PATH") | ||
# Check if the tag starts with "v" | ||
if [[ "$TAG_NAME" == v* ]]; then | ||
TAG_NAME_NO_V="${TAG_NAME#v}" # Remove "v" prefix | ||
if git rev-parse --quiet --verify "refs/tags/$TAG_NAME_NO_V"; then | ||
echo "Tag without 'v' already exists: $TAG_NAME_NO_V" | ||
else | ||
echo "Creating tag without 'v': $TAG_NAME_NO_V" | ||
git tag "$TAG_NAME_NO_V" "$GITHUB_SHA" | ||
git push origin "$TAG_NAME_NO_V" | ||
fi | ||
else | ||
TAG_NAME_WITH_V="v$TAG_NAME" # Add "v" prefix | ||
if git rev-parse --quiet --verify "refs/tags/$TAG_NAME_WITH_V"; then | ||
echo "Tag with 'v' already exists: $TAG_NAME_WITH_V" | ||
else | ||
echo "Creating tag with 'v': $TAG_NAME_WITH_V" | ||
git tag "$TAG_NAME_WITH_V" "$GITHUB_SHA" | ||
git push origin "$TAG_NAME_WITH_V" | ||
fi | ||
fi | ||
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,37 @@ | ||
import shutil | ||
import os | ||
|
||
def confirm_copy(): | ||
while True: | ||
response = input("Do you want to copy the files? (y/n): ").strip().lower() | ||
if response in ("y", "n"): | ||
return response == "y" | ||
else: | ||
print("Invalid input. Please enter 'y' or 'n'.") | ||
|
||
# Define the source and destination paths | ||
source_dir = "." # Root directory | ||
destination_dir = "source" # Destination folder | ||
|
||
# List of files to copy | ||
files_to_copy = ["main.ts", "manifest.json"] | ||
|
||
# Ensure the destination directory exists | ||
if not os.path.exists(destination_dir): | ||
os.makedirs(destination_dir) | ||
|
||
if confirm_copy(): | ||
# Copy each file to the destination directory | ||
for file_name in files_to_copy: | ||
source_path = os.path.join(source_dir, file_name) | ||
destination_path = os.path.join(destination_dir, file_name) | ||
|
||
try: | ||
shutil.copy(source_path, destination_path) | ||
print(f"Copied {file_name} to {destination_dir}") | ||
except FileNotFoundError: | ||
print(f"File {file_name} not found in the root directory.") | ||
|
||
print("Copy process completed.") | ||
else: | ||
print("Copy process aborted.") |
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