diff --git a/.github/workflows/label.yml b/.github/workflows/label.yml new file mode 100644 index 0000000..59175fe --- /dev/null +++ b/.github/workflows/label.yml @@ -0,0 +1,26 @@ +name: "Pull Request" +on: + pull_request: + types: [opened, synchronize, reopened, labeled] + +permissions: + pull-requests: write + contents: write + +jobs: + bypass-approver: + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + - name: Check for label and approve PR + run: | + labels=$(gh pr view ${{ github.event.pull_request.number }} --json labels -q '.labels[].name') + if echo "$labels" | grep -q "bypass"; then + pr_author="${{ github.event.pull_request.user.login }}" + gh pr review ${{ github.event.pull_request.number }} --approve + else + echo "Label not found, skipping approval" + fi + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/README.md b/README.md index 4023bc6..1d6a729 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,8 @@ This should be all that's needed: - DB_PASSWORD=password - DB_NAME=gradesa - `docker-compose up -d` — This command starts the services defined in the docker-compose.yml file in detached mode, meaning the services run in the background and the terminal is freed up for other tasks. For more information, checkout [Docker Compose docs](https://docs.docker.com/compose/) + - `npm install` in project root + - `cd ./gradesa && npm install` - `npm run dev` — Starts the dev server. - You can now find the NextJS app on localhost:3000