From 51cba682de300fee936cadac426ff241c3f36a51 Mon Sep 17 00:00:00 2001 From: Joshua Fish Date: Thu, 13 Jul 2023 16:28:47 +1000 Subject: [PATCH 1/4] main branch with release workflow --- .github/workflows/release.yml | 50 +++++++++++++++++++++++++++++++++++ 1 file changed, 50 insertions(+) create mode 100644 .github/workflows/release.yml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..bd94205 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,50 @@ +name: Create Release +on: + workflow_dispatch: + inputs: + releaseType: + description: Create a draft release + required: true + type: boolean + default: true + push: + branches: + - main +concurrency: + group: release + cancel-in-progress: false +run-name: Release ${{ github.sha }} by @${{ github.actor }} +permissions: + contents: write + id-token: write + pull-requests: read +jobs: + get-version: + runs-on: ubuntu-latest + outputs: + version: ${{ steps.get-version.outputs.version }} + steps: + - uses: actions/checkout@v3 + - name: Get Release Version + id: get-version + uses: nullify-platform/github-actions/actions/release-version@main + - run: | + echo "config-file-parser @ ${{ github.sha }}" >> $GITHUB_STEP_SUMMARY + echo "VERSION: ${{ steps.get-version.outputs.version }}" >> $GITHUB_STEP_SUMMARY + echo "SHORT_SHA: $(git rev-parse --short HEAD)" >> $GITHUB_STEP_SUMMARY + release: + if: ${{ needs.get-version.outputs.version != 'undefined' || (github.event_name == 'workflow_dispatch' && needs.get-version.outputs.version != 'undefined') }} + runs-on: ubuntu-latest + needs: [ get-version ] + steps: + - uses: actions/checkout@v3 + - name: Generate Release Tag + run: echo "RELEASE_TAG=v${{ needs.get-version.outputs.version }}" >> $GITHUB_ENV + - name: Generate Release + uses: softprops/action-gh-release@v1 + with: + draft: false + generate_release_notes: true + append_body: true + tag_name: ${{ env.RELEASE_TAG }} + token: ${{ secrets.GITHUB_TOKEN }} \ No newline at end of file From b1a79f078cd3e0839a9cfad596f73c12553fb34c Mon Sep 17 00:00:00 2001 From: Joshua Fish Date: Thu, 13 Jul 2023 16:23:01 +1000 Subject: [PATCH 2/4] added nullify url --- go.mod | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/go.mod b/go.mod index bb0fa5a..c502a46 100644 --- a/go.mod +++ b/go.mod @@ -1,4 +1,4 @@ -module github.com/go-playground/webhooks/v6 +module github.com/nullify-platform/webhooks go 1.17 From 5212de2df8350e0916d8d59081a77ea65df23faa Mon Sep 17 00:00:00 2001 From: Joshua Fish Date: Thu, 13 Jul 2023 16:33:53 +1000 Subject: [PATCH 3/4] added labels workflow --- .github/workflows/ci-require-labels.yml | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 .github/workflows/ci-require-labels.yml diff --git a/.github/workflows/ci-require-labels.yml b/.github/workflows/ci-require-labels.yml new file mode 100644 index 0000000..6883a87 --- /dev/null +++ b/.github/workflows/ci-require-labels.yml @@ -0,0 +1,19 @@ +# Require labels to be added to a PR before merging +# This is configured as a branch protection setting +name: CI Require Labels +on: + pull_request: + types: [opened, labeled, unlabeled, synchronize] + merge_group: +run-name: CI Require Labels ${{ github.sha }} by @${{ github.actor }} +jobs: + require-labels: + if: ${{ github.event_name == 'pull_request' }} + runs-on: ubuntu-latest + outputs: + status: ${{ steps.require-labels.outputs.status }} + steps: + - uses: actions/checkout@v3 + - name: Require Labels + id: require-labels + uses: nullify-platform/github-actions/actions/require-labels@main \ No newline at end of file From 4b4d7a18fcaa76177dd179f91884dd6a1aac5f06 Mon Sep 17 00:00:00 2001 From: Tim Thacker Date: Wed, 6 Dec 2023 14:39:21 +1100 Subject: [PATCH 4/4] fix check suite payload --- github/payload.go | 44 +++++++++++++++++++++++++++++++++----------- 1 file changed, 33 insertions(+), 11 deletions(-) diff --git a/github/payload.go b/github/payload.go index d3e343f..2485ece 100644 --- a/github/payload.go +++ b/github/payload.go @@ -216,17 +216,39 @@ type CheckRunPayload struct { type CheckSuitePayload struct { Action string `json:"action"` CheckSuite struct { - ID int64 `json:"id"` - NodeID string `json:"node_id"` - HeadBranch string `json:"head_branch"` - HeadSHA string `json:"head_sha"` - Status string `json:"status"` - Conclusion string `json:"conclusion"` - URL string `json:"url"` - Before string `json:"before"` - After string `json:"after"` - PullRequests []PullRequestPayload `json:"pull_requests"` - App struct { + ID int64 `json:"id"` + NodeID string `json:"node_id"` + HeadBranch string `json:"head_branch"` + HeadSHA string `json:"head_sha"` + Status string `json:"status"` + Conclusion string `json:"conclusion"` + URL string `json:"url"` + Before string `json:"before"` + After string `json:"after"` + PullRequests []struct { + URL string `json:"url"` + ID int64 `json:"id"` + Number int64 `json:"number"` + Head struct { + Ref string `json:"ref"` + SHA string `json:"sha"` + Repo struct { + ID int64 `json:"id"` + URL string `json:"url"` + Name string `json:"name"` + } `json:"repo"` + } `json:"head"` + Base struct { + Ref string `json:"ref"` + SHA string `json:"sha"` + Repo struct { + ID int64 `json:"id"` + URL string `json:"url"` + Name string `json:"name"` + } `json:"repo"` + } `json:"base"` + } `json:"pull_requests"` + App struct { ID int64 `json:"id"` NodeID string `json:"node_id"` Owner struct {