From bbd7690dd18cc498f0f4e1d4fb0b36de5451d91d Mon Sep 17 00:00:00 2001 From: Demetrius Kanios Date: Wed, 16 Sep 2026 10:19:15 -0700 Subject: [PATCH] chore(ci): Adjust `pumpkin-plugin-wit` CI workflows (#3454) * chore(ci): Adjust `pumpkin-plugin-wit` CI workflows * Fix close-prs workflow Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> Signed-off-by: Demetrius Kanios --------- Signed-off-by: Demetrius Kanios Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- .github/workflows/close-prs.yml | 28 ++++++++++++++++++++++++++++ .github/workflows/test-bindgen.yml | 15 +++------------ 2 files changed, 31 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/close-prs.yml diff --git a/.github/workflows/close-prs.yml b/.github/workflows/close-prs.yml new file mode 100644 index 0000000..a7f8795 --- /dev/null +++ b/.github/workflows/close-prs.yml @@ -0,0 +1,28 @@ +name: Close PRs + +on: + pull_request_target: + types: [opened, reopened] + workflow_dispatch: + +permissions: + pull-requests: write + +jobs: + manage-prs: + runs-on: ubuntu-slim + steps: + - name: "Close PR(s)" + run: | + if [ "${{ github.event_name }}" = "pull_request" ]; then + echo "${{ github.event.pull_request.number }}" + else + gh pr list --state open --limit 200 --json number --jq '.[].number' + fi | while read pr; do + if [ -n "$pr" ]; then + echo "Closing PR #$pr" + gh pr close $pr --comment "This repository does not accept direct pull requests. See #44 for details." + fi + done + env: + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/test-bindgen.yml b/.github/workflows/test-bindgen.yml index fc4e2a2..b3dc3ee 100644 --- a/.github/workflows/test-bindgen.yml +++ b/.github/workflows/test-bindgen.yml @@ -1,20 +1,11 @@ name: Test `wit-bindgen` against the WIT on: [push, pull_request, workflow_dispatch] -permissions: - contents: write - pull-requests: write - jobs: test-bindgen: name: Test with `wit-bindgen` runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v7 - - - name: Setup `wit-bindgen` - uses: bytecodealliance/actions/wit-bindgen/setup@v1 - - - name: Test WIT - run: wit-bindgen rust v0.1 + - uses: actions/checkout@v7 + - uses: bytecodealliance/actions/wit-bindgen/setup@v1 + - run: wit-bindgen rust v0.1