Skip to content

armgit / mocha

Public Imported from GitHub
0

☕️ Classic, reliable, trusted test framework for Node.js and the browser

chore: auto-add GitHub items to project (#5686)

Copilotd24c3205cb0a
diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml
new file mode 100644
index 00000000..56b93a37
--- /dev/null
+++ b/.github/workflows/add-to-project.yml
@@ -0,0 +1,28 @@
+name: Auto Add to Mocha Project
+
+# Automatically adds issues to our GitHub Project
+# We silence all failures to reduce noise
+# https://docs.github.com/en/issues/planning-and-tracking-with-projects/automating-your-project/automating-projects-using-actions
+
+on:
+ issues:
+ types: [opened, reopened]
+ pull_request:
+ types: [opened, reopened]
+
+permissions:
+ issues: write
+ pull-requests: write
+ repository-projects: write
+
+jobs:
+ add-to-project:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/[email protected]
+ # non-critical workflow, we will investigate errors manually
+ continue-on-error: true
+ with:
+ github-token: ${{ secrets.GITHUB_TOKEN }}
+ # Project URL for Mocha project board
+ project-url: https://github.com/orgs/mochajs/projects/6
diff --git a/.github/workflows/auto-label.yml b/.github/workflows/auto-label.yml
new file mode 100644
index 00000000..bf492ec7
--- /dev/null
+++ b/.github/workflows/auto-label.yml
@@ -0,0 +1,26 @@
+name: Auto Label Issues
+
+# Labels issues as "needs: triage" when first opened
+
+on:
+ issues:
+ types: [opened]
+
+permissions:
+ issues: write
+ pull-requests: write
+ contents: read
+
+jobs:
+ add-needs-triage:
+ runs-on: ubuntu-latest
+ steps:
+ - uses: actions/github-script@v7
+ with:
+ script: |
+ await github.rest.issues.addLabels({
+ owner: context.repo.owner,
+ repo: context.repo.repo,
+ issue_number: context.issue.number,
+ labels: ['needs: triage']
+ });