From b1005af70587bb2950470917ad1340b9c507e781 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Mon, 17 Jul 2023 14:14:33 -0500 Subject: [PATCH 1/3] Update Action labels (#7688) * chore: update action labels * chore: add label actions --- .github/labeler.yml | 22 ++++++++--------- .github/workflows/check-merge.yml | 2 +- .github/workflows/issue-labeled.yml | 32 +++++++++++++++++++++++++ .github/workflows/issue-needs-repro.yml | 18 ++++++++++++++ .github/workflows/issue-opened.yml | 23 ++++++++++++++++++ 5 files changed, 85 insertions(+), 12 deletions(-) create mode 100644 .github/workflows/issue-labeled.yml create mode 100644 .github/workflows/issue-needs-repro.yml create mode 100644 .github/workflows/issue-opened.yml diff --git a/.github/labeler.yml b/.github/labeler.yml index 185c6dd3ee4d..82638ac7f235 100644 --- a/.github/labeler.yml +++ b/.github/labeler.yml @@ -1,37 +1,37 @@ # See https://github.com/actions/labeler -example: +'pkg: example': - examples/**/* '🚨 action': - .github/workflows/** -core: +'pkg: astro': - packages/astro/** -create-astro: +'pkg: create-astro': - packages/create-astro/** -markdown: +'feat: markdown': - packages/markdown/** -integration: +'pkg: integration': - packages/integrations/** -framework-lit: +'pkg: lit': - packages/integrations/lit/** -framework-preact: +'pkg: preact': - packages/integrations/preact/** -framework-react: +'pkg: react': - packages/integrations/react/** -framework-solid: +'pkg: solid': - packages/integrations/solid/** -framework-svelte: +'pkg: svelte': - packages/integrations/svelte/** -framework-vue: +'pkg: vue': - packages/integrations/vue/** diff --git a/.github/workflows/check-merge.yml b/.github/workflows/check-merge.yml index 4800601ba44a..378c595274f5 100644 --- a/.github/workflows/check-merge.yml +++ b/.github/workflows/check-merge.yml @@ -69,7 +69,7 @@ jobs: issue_number: process.env.issue_number, owner: context.repo.owner, repo: context.repo.repo, - labels: ['semver minor'] + labels: ['semver: minor'] }); - name: Change PR Status diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml new file mode 100644 index 000000000000..853455ef33b4 --- /dev/null +++ b/.github/workflows/issue-labeled.yml @@ -0,0 +1,32 @@ +name: Issue Labeled + +on: + issues: + types: [labeled] + +jobs: + reply-labeled: + if: github.repository == 'withastro/astro' + runs-on: ubuntu-latest + steps: + - name: remove triage + if: | + ${{ contains(github.event.label.description, '(priority)') && contains(github.event.issue.labels.*.name, 'needs: triage') }} + uses: actions-cool/issues-helper@v3 + with: + actions: "remove-labels" + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + labels: "needs: triage" + + - name: needs repro + if: | + ${{ github.event.label.name == 'needs: repro' }} + uses: actions-cool/issues-helper@v3 + with: + actions: "create-comment, remove-labels" + token: ${{ secrets.GITHUB_TOKEN }} + issue-number: ${{ github.event.issue.number }} + body: | + Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://astro.new). Issues marked with `needs: repro` will be closed if they have no activity within 3 days. + labels: "needs: triage" diff --git a/.github/workflows/issue-needs-repro.yml b/.github/workflows/issue-needs-repro.yml new file mode 100644 index 000000000000..47b73ac5b889 --- /dev/null +++ b/.github/workflows/issue-needs-repro.yml @@ -0,0 +1,18 @@ +name: Close Issues (needs repro) + +on: + schedule: + - cron: "0 0 * * *" + +jobs: + close-issues: + if: github.repository == 'withastro/astro' + runs-on: ubuntu-latest + steps: + - name: needs repro + uses: actions-cool/issues-helper@v3 + with: + actions: "close-issues" + token: ${{ secrets.GITHUB_TOKEN }} + labels: "needs: repro" + inactive-day: 3 diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml new file mode 100644 index 000000000000..83e195cd9b36 --- /dev/null +++ b/.github/workflows/issue-opened.yml @@ -0,0 +1,23 @@ +name: Label issues +on: + issues: + types: + - reopened + - opened + +jobs: + label_issues: + runs-on: ubuntu-latest + if: github.repository == 'withastro/astro' + permissions: + issues: write + steps: + - uses: actions/github-script@v6 + with: + script: | + github.rest.issues.addLabels({ + issue_number: context.issue.number, + owner: context.repo.owner, + repo: context.repo.repo, + labels: ["needs: triage"] + }) From 474ea808e7d982b93aa705d3d7cb0f7251518915 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Mon, 17 Jul 2023 14:48:24 -0500 Subject: [PATCH 2/3] fix(ci): handle needs labels properly (#7689) --- .github/workflows/issue-labeled.yml | 11 +++++------ .github/workflows/issue-needs-repro.yml | 2 +- .github/workflows/issue-opened.yml | 2 +- 3 files changed, 7 insertions(+), 8 deletions(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 853455ef33b4..441f9772330b 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -10,23 +10,22 @@ jobs: runs-on: ubuntu-latest steps: - name: remove triage - if: | - ${{ contains(github.event.label.description, '(priority)') && contains(github.event.issue.labels.*.name, 'needs: triage') }} + if: contains(github.event.label.description, '(priority)') && contains(github.event.issue.labels.*.name, 'needs triage') uses: actions-cool/issues-helper@v3 with: actions: "remove-labels" token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} - labels: "needs: triage" + labels: "needs triage" - name: needs repro if: | - ${{ github.event.label.name == 'needs: repro' }} + ${{ github.event.label.name == 'needs repro' }} uses: actions-cool/issues-helper@v3 with: actions: "create-comment, remove-labels" token: ${{ secrets.GITHUB_TOKEN }} issue-number: ${{ github.event.issue.number }} body: | - Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://astro.new). Issues marked with `needs: repro` will be closed if they have no activity within 3 days. - labels: "needs: triage" + Hello @${{ github.event.issue.user.login }}. Please provide a [minimal reproduction](https://stackoverflow.com/help/minimal-reproducible-example) using a GitHub repository or [StackBlitz](https://astro.new). Issues marked with `needs repro` will be closed if they have no activity within 3 days. + labels: "needs triage" diff --git a/.github/workflows/issue-needs-repro.yml b/.github/workflows/issue-needs-repro.yml index 47b73ac5b889..a859d85ad7ed 100644 --- a/.github/workflows/issue-needs-repro.yml +++ b/.github/workflows/issue-needs-repro.yml @@ -14,5 +14,5 @@ jobs: with: actions: "close-issues" token: ${{ secrets.GITHUB_TOKEN }} - labels: "needs: repro" + labels: "needs repro" inactive-day: 3 diff --git a/.github/workflows/issue-opened.yml b/.github/workflows/issue-opened.yml index 83e195cd9b36..005d372085b3 100644 --- a/.github/workflows/issue-opened.yml +++ b/.github/workflows/issue-opened.yml @@ -19,5 +19,5 @@ jobs: issue_number: context.issue.number, owner: context.repo.owner, repo: context.repo.repo, - labels: ["needs: triage"] + labels: ["needs triage"] }) From 6ad4672ef17a6ee1f5cdd02839e285fc22e72e91 Mon Sep 17 00:00:00 2001 From: Nate Moore Date: Mon, 17 Jul 2023 14:53:51 -0500 Subject: [PATCH 3/3] fix(ci): fix action needs-repro action (#7690) --- .github/workflows/issue-labeled.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/issue-labeled.yml b/.github/workflows/issue-labeled.yml index 441f9772330b..8723639c7ff7 100644 --- a/.github/workflows/issue-labeled.yml +++ b/.github/workflows/issue-labeled.yml @@ -19,8 +19,7 @@ jobs: labels: "needs triage" - name: needs repro - if: | - ${{ github.event.label.name == 'needs repro' }} + if: github.event.label.name == 'needs repro' uses: actions-cool/issues-helper@v3 with: actions: "create-comment, remove-labels"