Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/github_actions/guibranco/github-i…
Browse files Browse the repository at this point in the history
…nfisical-secrets-check-action-1.1.24
  • Loading branch information
gstraccini[bot] authored Dec 30, 2024
2 parents 4e873b6 + dc28b4e commit 2d9df4e
Show file tree
Hide file tree
Showing 7 changed files with 267 additions and 79 deletions.
16 changes: 16 additions & 0 deletions .githooks/pre-commit
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#!/usr/bin/env bash
LC_ALL=C

local_branch="$(git rev-parse --abbrev-ref HEAD)"

valid_branch_regex="^(penify|gitauto|dependabot|feature|fix|docs|style|refactor|perf|hotfix|test|chore|create)(\/[a-zA-Z0-9#._-]+)+$"

message="There is something wrong with your branch name. Branch names in this project must adhere to this contract: $valid_branch_regex. Your commit will be rejected. You should rename your branch to a valid name and try again."

if [[ ! $local_branch =~ $valid_branch_regex ]]
then
echo "$message"
exit 1
fi

#npm run lint
39 changes: 39 additions & 0 deletions .githooks/prepare-commit-msg
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/sh

# This script generates an AI-powered commit message using dotnet-aicommitmessage.
# It can be bypassed by setting the GIT_AICOMMIT_SKIP environment variable.

# Exit immediately if GIT_AICOMMIT_SKIP is set
if [ -n "$GIT_AICOMMIT_SKIP" ]; then
exit 0
fi

if ! command -v dotnet-aicommitmessage &> /dev/null; then
echo "Error: dotnet-aicommitmessage is not installed or not in PATH" >&2
echo "Please install it by running 'dotnet tool install -g aicommitmessage'" >&2
exit 1
fi

COMMIT_MSG_FILE=$1
CURRENT_MESSAGE=$(cat "$COMMIT_MSG_FILE")

# From version 0.6.1, this is not needed anymore.
# GIT_DIFF=$(git diff --staged)
# GIT_BRANCH_NAME=$(git rev-parse --abbrev-ref HEAD)

# Run dotnet-aicommitmessage with error handling
# From version 0.6.1 branch and diff are now retrieved by the tool and don't need to be passed manually.
# Version 0.6.1 and higher: dotnet-aicommitmessage generate-message -m "$CURRENT_MESSAGE"
# Version 0.6.0 and lower: dotnet-aicommitmessage generate-message -m "$CURRENT_MESSAGE" -b "$GIT_BRANCH_NAME" -d "$GIT_DIFF"

if ! AI_MESSAGE=$(dotnet-aicommitmessage generate-message -m "$CURRENT_MESSAGE"); then
echo "Error: Failed to generate AI commit message. Using original message." >&2
exit 0
fi

if [[ -z "$AI_MESSAGE" || "$AI_MESSAGE" =~ ^[[:space:]]*$ ]]; then
echo "Error: Generated commit message is empty." >&2
exit 1
fi
echo "$AI_MESSAGE" > "$COMMIT_MSG_FILE"
exit 0
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,6 @@ on:
- main
pull_request:
types: [opened, synchronize, reopened]
pull_request_target:
types: [opened, synchronize, reopened]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand All @@ -17,26 +15,31 @@ jobs:
name: SonarCloud
runs-on: ubuntu-latest
steps:

- uses: actions/checkout@v4
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0

- name: Set up Node.js 22
uses: actions/setup-node@v4
with:
fetch-depth: 0
node-version: 22.x

- name: Install dependencies
run: npm install
run: npm ci

- name: Build
run: npm run build

- name: Test and coverage
run: npm run test -- --coverage --watchAll=false
- name: Test
run: npm test -- --coverage --watchAll=false

- name: SonarCloud Scan
uses: SonarSource/sonarcloud-github-action@master
if: >-
(
github.event_name == 'pull_request' &&
github.event.pull_request.head.repo.full_name == github.repository
) || (
github.event_name == 'pull_request_target' &&
github.event.pull_request.head.repo.full_name != github.repository
) || (
github.event_name == 'workflow_dispatch'
)
Expand Down
103 changes: 48 additions & 55 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
"react": "^19.0.0",
"react-cookie-consent": "^9.0.0",
"react-dom": "^19.0.0",
"react-router-dom": "^6.28.1",
"react-scripts": "^5.0.1",
"react-select": "^5.9.0",
"react-string-replace": "^1.1.1",
Expand Down Expand Up @@ -44,6 +45,6 @@
]
},
"devDependencies": {
"react-router-dom": "^7.1.0"
"@babel/plugin-proposal-private-property-in-object": "^7.21.11"
}
}
26 changes: 16 additions & 10 deletions src/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,16 +10,22 @@ import ErrorBoundary from "./Helpers/ErrorBoundary";
function App() {
return (
<ErrorBoundary>
<BrowserRouter basename={'/ui/vagas'}>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<Vagas />} />
<Route path="repositorios" element={<Repositorios />} />
<Route path="recrutadores" element={<Recrutadores />} />
<Route path="nova-vaga" element={<NovaVaga />} />
</Route>
</Routes>
</BrowserRouter>
<BrowserRouter
basename={"/ui/vagas"}
future={{
v7_startTransition: true,
v7_relativeSplatPath: true,
}}
>
<Routes>
<Route path="/" element={<Layout />}>
<Route index element={<Vagas />} />
<Route path="repositorios" element={<Repositorios />} />
<Route path="recrutadores" element={<Recrutadores />} />
<Route path="nova-vaga" element={<NovaVaga />} />
</Route>
</Routes>
</BrowserRouter>
</ErrorBoundary>
);
}
Expand Down
Loading

0 comments on commit 2d9df4e

Please sign in to comment.