Skip to content

Commit

Permalink
🔧Fix git config and git log
Browse files Browse the repository at this point in the history
  • Loading branch information
7rikazhexde committed Nov 10, 2024
1 parent 948ec6b commit a07f178
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 17 deletions.
32 changes: 16 additions & 16 deletions .github/workflows/dependabot_prch.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ jobs:
echo "versions_python: ${{ steps.json2vars.outputs.versions_python }}"
echo "ghpages_branch: ${{ steps.json2vars.outputs.ghpages_branch }}"
run_tests:
test:
needs: set_variables
strategy:
matrix:
Expand Down Expand Up @@ -79,7 +79,7 @@ jobs:
shell: bash
run: |
echo "System date: $(date)"
echo "TZ environment variable: $TZ"
echo "TZ environment variable: ${TZ}"
python -c "import datetime, platform; print(f'Python timezone: {datetime.datetime.now().astimezone().tzinfo}'); print(f'OS: {platform.system()}')"
- name: Install poetry
run: pip install poetry
Expand All @@ -100,17 +100,16 @@ jobs:
run: |
poetry run task test_ci_xml
coverage_percentage=$(poetry run coverage report | grep TOTAL | awk '{print $NF}' | sed 's/%//')
echo "Current coverage: $coverage_percentage%"
echo "COVERAGE=$coverage_percentage" >> "$GITHUB_ENV"
echo "Current coverage: ${coverage_percentage}%"
echo "COVERAGE=${coverage_percentage}" >> "$GITHUB_ENV"
- name: Check coverage
shell: bash
run: |
if [[ ! "$COVERAGE" =~ ^[0-9]+$ ]]; then
echo "Error: Invalid coverage value: ${COVERAGE}"
elif [ "$COVERAGE" -lt 90 ]; then
if [ "${COVERAGE}" -lt 90 ]; then
echo "Test coverage is below 90%. Current coverage: ${COVERAGE}%"
exit 1
else
echo "Test coverage is above or equal to 90%. Current coverage: $COVERAGE%"
echo "Test coverage is above or equal to 90%. Current coverage: ${COVERAGE}%"
fi
- name: Pytest coverage comment
id: coverageComment
Expand Down Expand Up @@ -141,30 +140,31 @@ jobs:
echo -e ${{ steps.coverageComment.outputs.summaryReport }} >> "$GITHUB_STEP_SUMMARY"
check_all_tests:
needs: run_tests
needs: test
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' && !startsWith(github.event.pull_request.title, 'Bump version')
steps:
- name: Check test results
if: contains(needs.run_tests.result, 'failure')
if: contains(needs.test.result, 'failure')
run: |
echo "Some tests failed. Please check the test results and fix any issues before merging."
exit 1
send_notification:
needs: [run_tests, check_all_tests]
needs: [test, check_all_tests]
runs-on: ubuntu-latest
if: github.actor == 'dependabot[bot]' && !startsWith(github.event.pull_request.title, 'Bump version')
steps:
# https://docs.github.com/ja/actions/security-guides/using-secrets-in-github-actions#creating-secrets-for-an-environment
- name: Send LINE Notify
env:
LINE_NOTIFY_TOKEN: ${{ secrets.LINE_NOTIFY_TOKEN }}
run: |
status="${{ contains(needs.run_tests.result, 'failure') && 'FAILED' || 'SUCCESS' }}"
message="'dependabot_prch' workflow completed with status: $status
status="${{ contains(needs.test.result, 'failure') && 'FAILED' || 'SUCCESS' }}"
message="'dependabot_prch' workflow completed with status: ${status}
Check URL:
https://github.com/7rikazhexde/json2vars-setter/actions/workflows/dependabot_prch.yml"
https://github.com/7rikazhexde/python-project-sandbox/actions/workflows/dependabot_prch.yml"
curl -X POST https://notify-api.line.me/api/notify \
-H "Authorization: Bearer $LINE_NOTIFY_TOKEN" \
-H "Authorization: Bearer ${LINE_NOTIFY_TOKEN}" \
-F "message=${message}"
5 changes: 4 additions & 1 deletion .github/workflows/update_pre-commit_hooks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,14 @@ on:
jobs:
update:
runs-on: ubuntu-latest
permissions:
# Enable file changes, commits, and pushes
contents: write
steps:
- uses: actions/[email protected]
with:
fetch-depth: 0
token: ${{ secrets.PAT_FOR_PUSHES }}
token: ${{ secrets.GITHUB_TOKEN }}
- name: Set up Python
uses: actions/[email protected]
with:
Expand Down

0 comments on commit a07f178

Please sign in to comment.