From e072b64992fcf11fcf914f1a981e99681f4ddc11 Mon Sep 17 00:00:00 2001 From: Jan <45685070+LeRoid-hub@users.noreply.github.com> Date: Thu, 7 Nov 2024 10:46:56 +0100 Subject: [PATCH] Create pr.yml --- .github/workflows/pr.yml | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/pr.yml diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml new file mode 100644 index 0000000..dfb94c4 --- /dev/null +++ b/.github/workflows/pr.yml @@ -0,0 +1,34 @@ +name: On Pullrequest Test + +on: + pull_request: + types: [opened, ready_for_review, synchronize, reopened, closed] + +env: + # Use docker.io for Docker Hub if empty + REGISTRY: ghcr.io + IMAGE_NAME: leroid-hub/humiditycalc:latest + PAT: ${{ secrets.PAT }} + +jobs: + + test: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Set up Go + uses: actions/setup-go@v4 + with: + go-version: '1.23' + + - name: Build + run: go build -v ./... + - name: Actions Ntfy + run: | + curl \ + -u ${{ secrets.NTFY_CRED }} \ + -H "Title: Github Pull Request humiditycalc" \ + -H "Content-Type: text/plain" \ + -d $'Repo: ${{ github.repository }}\nCommit: ${{ github.sha }} - ${{ github.event.head_commit.message }}\nRef: ${{ github.ref }}\nStatus: ${{ job.status}}' \ + ${{ secrets.NTFY_URL }}