Skip to content

armgit / mocha

Public Imported from GitHub
0

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

chore: fixup "auto-add" workflow (#6308)

Mark Wiemerb3f7cbcb9915
diff --git a/.github/workflows/add-to-project.yml b/.github/workflows/add-to-project.yml
index 1e12edba..ccfd3541 100644
--- a/.github/workflows/add-to-project.yml
+++ b/.github/workflows/add-to-project.yml
@@ -1,8 +1,9 @@
-name: Auto Add to Mocha Project
+name: Auto-add item 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
+# Automatically adds issues to our GitHub project.
+# We silence "add" failures to reduce noise.
+# (This often happens when issues are created from project GUI.)
+# https://markwiemer.com/software/github/apps#auto-add
on:
issues:
@@ -10,19 +11,21 @@ on:
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
+ # https://github.com/actions/create-github-app-token
+ - uses: actions/create-github-app-token@v3
+ id: app-token
+ with:
+ # https://github.com/mochajs/mocha/settings/secrets/actions
+ client-id: ${{ secrets.APP_CLIENT_ID }}
+ private-key: ${{ secrets.APP_PRIVATE_KEY }}
+ owner: mark-wiemer-org
+ # https://github.com/actions/add-to-project
+ - uses: actions/add-to-project@v2
with:
- github-token: ${{ secrets.GITHUB_TOKEN }}
- # Project URL for Mocha project board
project-url: https://github.com/orgs/mochajs/projects/6
+ github-token: ${{ steps.app-token.outputs.token }}
+ continue-on-error: true