Skip to content

Commit bdade39

Browse files
Merge branch 'main' into gitdepend
2 parents 09282c9 + 0e1ee96 commit bdade39

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1322
-282
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
# Pull Request
2-
3-
## Title
4-
<!--[Provide a succinct and descriptive title for the pull request.]-->
5-
61
## Type of Change
72
- [ ] New feature
83
- [ ] Bug fix

.github/workflows/pr-labels.yaml

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,17 @@
11
name: Manage labels based on PR body
22

33
on:
4-
pull_request:
4+
pull_request_target:
55
types: [opened, edited, reopened, synchronize]
66

77
jobs:
88
manage-labels:
99
runs-on: ubuntu-latest
1010
steps:
1111
- name: Analyze PR Body and manage labels
12+
shell: bash
1213
run: |
13-
body="${{ github.event.pull_request.body }}"
14+
body=$(jq -r '.pull_request.body' "$GITHUB_EVENT_PATH")
1415
labels_to_add=()
1516
labels_to_remove=()
1617
declare -A label_checks=(
@@ -20,19 +21,23 @@ jobs:
2021
["Refactoring"]="refactor"
2122
["UI/UX improvement"]="UI/UX"
2223
)
23-
for key in "${!label_checks[@]}"; do
24-
if echo "$body" | grep -q "\- \[x\] $key"; then
25-
labels_to_add+=("${label_checks[$key]}")
24+
for pattern in "${!label_checks[@]}"; do
25+
label="${label_checks[$pattern]}"
26+
if echo "$body" | grep -Eq "\- \[x\] ($pattern)"; then
27+
labels_to_add+=("$label")
2628
else
27-
labels_to_remove+=("${label_checks[$key]}")
29+
labels_to_remove+=("$label")
2830
fi
2931
done
30-
echo "LABELS_TO_ADD=${labels_to_add[*]}" >> $GITHUB_ENV
31-
echo "LABELS_TO_REMOVE=${labels_to_remove[*]}" >> $GITHUB_ENV
32+
33+
echo "LABELS_TO_ADD=$(IFS=,; echo "${labels_to_add[*]}")" >> $GITHUB_ENV
34+
echo "LABELS_TO_REMOVE=$(IFS=,; echo "${labels_to_remove[*]}")" >> $GITHUB_ENV
35+
3236
- name: Add labels if necessary
3337
if: env.LABELS_TO_ADD != ''
3438
run: |
35-
for label in ${{ env.LABELS_TO_ADD }}; do
39+
IFS=',' read -ra labels <<< "${LABELS_TO_ADD}"
40+
for label in "${labels[@]}"; do
3641
curl -s -X POST \
3742
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
3843
-H "Accept: application/vnd.github.v3+json" \
@@ -42,9 +47,10 @@ jobs:
4247
- name: Remove labels if necessary
4348
if: env.LABELS_TO_REMOVE != ''
4449
run: |
45-
for label in ${{ env.LABELS_TO_REMOVE }}; do
50+
IFS=',' read -ra labels <<< "${LABELS_TO_REMOVE}"
51+
for label in "${labels[@]}"; do
4652
curl -s -X DELETE \
4753
-H "Authorization: token ${{ secrets.GITHUB_TOKEN }}" \
4854
-H "Accept: application/vnd.github.v3+json" \
4955
https://api.github.com/repos/${{ github.repository }}/issues/${{ github.event.pull_request.number }}/labels/$label
50-
done
56+
done

start.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/sh -e
22

33
rc='\033[0m'
44
red='\033[0;31m'

startdev.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#!/bin/sh
1+
#!/bin/sh -e
22

33
RC='\033[0m'
44
RED='\033[0;31m'
@@ -35,7 +35,7 @@ check() {
3535
local message=$2
3636

3737
if [ $exit_code -ne 0 ]; then
38-
echo -e "${RED}ERROR: $message${RC}"
38+
printf "%b\n" "${RED}ERROR: $message${RC}"
3939
exit 1
4040
fi
4141
}

tabs/applications-setup/alacritty-setup.sh

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,33 +2,34 @@
22

33
. ../common-script.sh
44

5-
setupAlacritty() {
6-
echo "Install Alacritty if not already installed..."
5+
installAlacritty() {
6+
printf "%b\n" "${YELLOW}Installing Alacritty...${RC}"
77
if ! command_exists alacritty; then
8-
case ${PACKAGER} in
8+
case "$PACKAGER" in
99
pacman)
10-
$ESCALATION_TOOL ${PACKAGER} -S --needed --noconfirm alacritty
10+
$ESCALATION_TOOL "$PACKAGER" -S --needed --noconfirm alacritty
1111
;;
1212
*)
13-
$ESCALATION_TOOL ${PACKAGER} install -y alacritty
13+
$ESCALATION_TOOL "$PACKAGER" install -y alacritty
1414
;;
1515
esac
1616
else
17-
echo "alacritty is already installed."
17+
printf "%b\n" "${GREEN}Alacritty is already installed.${RC}"
1818
fi
1919
}
2020

2121
setupAlacrittyConfig() {
22-
echo "Copy alacritty config files"
22+
printf "%b\n" "${YELLOW}Copy alacritty config files${RC}"
2323
if [ -d "${HOME}/.config/alacritty" ] && [ ! -d "${HOME}/.config/alacritty-bak" ]; then
2424
cp -r "${HOME}/.config/alacritty" "${HOME}/.config/alacritty-bak"
2525
fi
2626
mkdir -p "${HOME}/.config/alacritty/"
2727
curl -sSLo "${HOME}/.config/alacritty/alacritty.toml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/alacritty.toml"
2828
curl -sSLo "${HOME}/.config/alacritty/nordic.toml" "https://github.com/ChrisTitusTech/dwm-titus/raw/main/config/alacritty/nordic.toml"
29+
printf "%b\n" "${GREEN}Alacritty configuration files copied.${RC}"
2930
}
3031

3132
checkEnv
3233
checkEscalationTool
33-
setupAlacritty
34+
installAlacritty
3435
setupAlacrittyConfig

0 commit comments

Comments
 (0)