From f3d77e7d19ad94cb67288127f4241e9a86432b87 Mon Sep 17 00:00:00 2001 From: Tom Meagher Date: Wed, 22 May 2024 19:09:27 -0400 Subject: [PATCH] ci: reusable workflows --- .../actions/install-dependencies/action.yml | 4 +-- .github/workflows/issue-labeled.yml | 19 ++++++++++++++ .github/workflows/issue-labelled.yml | 25 ------------------- .github/workflows/lock-issue.yml | 16 ++++++++++++ 4 files changed, 37 insertions(+), 27 deletions(-) create mode 100644 .github/workflows/issue-labeled.yml delete mode 100644 .github/workflows/issue-labelled.yml create mode 100644 .github/workflows/lock-issue.yml diff --git a/.github/actions/install-dependencies/action.yml b/.github/actions/install-dependencies/action.yml index afa7be0455..daa423a1b6 100644 --- a/.github/actions/install-dependencies/action.yml +++ b/.github/actions/install-dependencies/action.yml @@ -17,10 +17,10 @@ runs: - name: Set up Foundry uses: foundry-rs/foundry-toolchain@v1 - # TODO(3074): Remove this when 3074 supported natively in Anvil. + # TODO(3074): Remove this when 3074 supported natively in Anvil. - name: Set up Docker uses: docker-practice/actions-setup-docker@master - name: Install dependencies shell: bash - run: bun install \ No newline at end of file + run: bun install diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml new file mode 100644 index 0000000000..b37bc0868c --- /dev/null +++ b/.github/workflows/issue-labeled.yml @@ -0,0 +1,19 @@ +name: Issue Labeled + +on: + issues: + types: [labeled] + +jobs: + issue-labeled: + if: ${{ github.repository_owner == 'wevm' }} + uses: wevm/actions/.github/workflows/issue-labeled.yml@main + with: + needs-reproduction-body: | + Hello @${{ github.event.issue.user.login }}. + + Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using [StackBlitz](https://new.viem.sh), [TypeScript Playground](https://www.typescriptlang.org/play) (for type issues), or a separate minimal GitHub repository. + + [Minimal reproductions are required](https://antfu.me/posts/why-reproductions-are-required) as they save us a lot of time reproducing your config/environment and issue, and allow us to help you faster. + + Once a minimal reproduction is added, a team member will confirm it works, then re-open the issue. diff --git a/.github/workflows/issue-labelled.yml b/.github/workflows/issue-labelled.yml deleted file mode 100644 index a7cb47e1bb..0000000000 --- a/.github/workflows/issue-labelled.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Issue Labeled - -on: - issues: - types: [labeled] - -jobs: - reply-labeled: - runs-on: ubuntu-latest - steps: - - name: needs reproduction - if: github.event.label.name == 'needs reproduction' - uses: peter-evans/close-issue@v3 - with: - token: ${{ secrets.GITHUB_TOKEN }} - issue-number: ${{ github.event.issue.number }} - comment: | - Hello @${{ github.event.issue.user.login }}. - - Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using [StackBlitz](https://new.viem.sh), [TypeScript Playground](https://www.typescriptlang.org/play) (for type issues), or a separate minimal GitHub repository. - - Minimal reproductions are required as they save us a lot of time reproducing your config & environment, and trying to reproduce your issue. See [Why reproductions are required](https://antfu.me/posts/why-reproductions-are-required). - - Please reopen this issue when a reproduction is added. - close-reason: not_planned \ No newline at end of file diff --git a/.github/workflows/lock-issue.yml b/.github/workflows/lock-issue.yml new file mode 100644 index 0000000000..5068eada68 --- /dev/null +++ b/.github/workflows/lock-issue.yml @@ -0,0 +1,16 @@ +name: Lock Issue + +on: + schedule: + - cron: '0 0 * * *' + +jobs: + lock-issue: + if: ${{ github.repository_owner == 'wevm' }} + uses: wevm/actions/.github/workflows/lock-issue.yml@main + with: + issue-comment: | + This issue has been locked since it has been closed for more than 14 days. + + If you found a concrete bug or regression related to it, please open a new [bug report](https://github.com/wevm/viem/issues/new?template=bug_report.yml) with a reproduction against the latest Viem version. If you have any questions or comments you can create a new [discussion thread](https://github.com/wevm/viem/discussions). +