Skip to content

Commit

Permalink
Merge pull request #15 from lpm0073/next
Browse files Browse the repository at this point in the history
refactor pr controller logic
  • Loading branch information
lpm0073 authored Nov 28, 2023
2 parents 081e9c0 + 8521a2e commit 3b949fa
Show file tree
Hide file tree
Showing 7 changed files with 8 additions and 34 deletions.
17 changes: 0 additions & 17 deletions .github/actions/tests/pre-commit/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,6 @@ inputs:
description: "The version of Python to use, such as 3.11.0"
required: true
type: string
github-token:
description: "The GitHub token to use for pushing changes to the repository"
required: true
type: string

runs:
using: "composite"
Expand Down Expand Up @@ -101,19 +97,6 @@ runs:
run: |
npx prettier --write --log-level silent .
- name: Lint commit and push
id: lint-commit-and-push
shell: bash
run: |
git pull
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add .
git commit -m "chore: [gh] lint w black / prettier [skip ci]"
git push https://${{ env.GITHUB_TOKEN }}@github.com/${{ github.repository }}.git HEAD:${{ github.ref }}
env:
GITHUB_TOKEN: ${{ inputs.github-token }}

# see: https://pre-commit.ci/lite.html
- name: pre-commit
id: pre-commit
Expand Down
13 changes: 1 addition & 12 deletions .github/workflows/pullRequestController.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ name: Pull Request Controller

on:
workflow_dispatch:

# GitHub Copilot: The `pull_request` and `pull_request_target` are two different
# event types in GitHub Actions that trigger workflows when activity related
# to pull requests occurs.
Expand All @@ -43,16 +42,7 @@ on:
# In general, use `pull_request` for workflows that need to access the code in the pull request,
# and `pull_request_target` for workflows that need to be safe for pull requests from forks.
pull_request_target:
types:
[
opened,
closed,
synchronize,
edited,
ready_for_review,
review_requested,
assigned,
]
types: [opened, closed, synchronize, edited]
paths:
- "**.py"
- "**.requirements.txt"
Expand Down Expand Up @@ -136,4 +126,3 @@ jobs:
uses: ./.github/actions/tests/pre-commit
with:
python-version: "${{ env.python-version}}"
github-token: ${{ secrets.PAT }}
2 changes: 1 addition & 1 deletion .github/workflows/runTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ name: Run all tests

on:
workflow_dispatch:

env:
python-version: "3.11"

Expand All @@ -30,4 +31,3 @@ jobs:
uses: ./.github/actions/tests/pre-commit
with:
python-version: "${{ env.python-version}}"
github-token: ${{ secrets.PAT }}
1 change: 1 addition & 0 deletions .github/workflows/semanticVersionBumpMerge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ jobs:
if: env.VERSION_CHANGED == 'true'
id: update_version
run: |
echo "# -*- coding: utf-8 -*-" > __version__.py
echo "__version__ = '${{ env.NEXT_VERSION }}'" > __version__.py
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
Expand Down
3 changes: 1 addition & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@

## [1.1.2](https://github.com/lpm0073/automatic-grader/compare/v1.1.1...v1.1.2) (2023-11-28)


### Bug Fixes

* add shell ([0f03b26](https://github.com/lpm0073/automatic-grader/commit/0f03b2655cbf4ffd32d65cf1ac45773bd05d2cb1))
- add shell ([0f03b26](https://github.com/lpm0073/automatic-grader/commit/0f03b2655cbf4ffd32d65cf1ac45773bd05d2cb1))

## [1.1.1](https://github.com/lpm0073/automatic-grader/compare/v1.1.0...v1.1.1) (2023-11-28)

Expand Down
3 changes: 2 additions & 1 deletion __version__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__version__ = '1.1.3'
# -*- coding: utf-8 -*-
__version__ = "1.1.3"
3 changes: 2 additions & 1 deletion grader/__version__.py
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
__version__ = '1.1.3'
# -*- coding: utf-8 -*-
__version__ = "1.1.3"

0 comments on commit 3b949fa

Please sign in to comment.