Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/grumpy-ears-grow.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@nylas/react": patch
---

Update @nylas/web-elements dependency from 2.3.0 to 2.3.2
34 changes: 33 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,9 @@
pull-requests: write # to create release PRs
id-token: write # for NPM provenance
timeout-minutes: 15
outputs:
published: ${{ steps.changesets.outputs.published }}
publishedPackages: ${{ steps.changesets.outputs.publishedPackages }}

steps:
- name: Checkout code
Expand Down Expand Up @@ -87,4 +90,33 @@
createGithubReleases: true
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Only needed for installing private dependencies
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # do not remove this line (https://github.com/changesets/action/issues/98)
PM_CONFIG_PROVENANCE: true

# Slack notification job (only when packages are published)
notify:
name: Notify Slack
runs-on: ubuntu-latest
needs: release
if: needs.release.outputs.published == 'true'

steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: ${{ env.NODE_VERSION }}

- name: Setup pnpm
uses: pnpm/action-setup@v4
with:
run_install: false

- name: Install dependencies
run: pnpm install --frozen-lockfile

- name: Send Slack notification
run: pnpm slack:notify '${{ needs.release.outputs.publishedPackages }}' ${{ vars.SLACK_WEBHOOK_URL }}
Comment on lines +99 to +122

Check warning

Code scanning / CodeQL

Workflow does not contain permissions Medium

Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}

Copilot Autofix

AI 3 days ago

To fix the problem, add an explicit permissions block to the notify job so it does not inherit potentially broad repository defaults. This block should grant only the minimal necessary access. Since notify just checks out code and runs a pnpm-based Slack notification script, contents: read is sufficient.

Concretely, in .github/workflows/release.yml, under the notify job (around line 99, right after runs-on: ubuntu-latest and before needs: release), insert:

    permissions:
      contents: read

This keeps existing functionality intact while constraining GITHUB_TOKEN for this job to read-only repository contents. No new imports, methods, or other definitions are required; this is purely a workflow configuration change.

Suggested changeset 1
.github/workflows/release.yml

Autofix patch

Autofix patch
Run the following command in your local git repository to apply this patch
cat << 'EOF' | git apply
diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml
--- a/.github/workflows/release.yml
+++ b/.github/workflows/release.yml
@@ -98,6 +98,8 @@
   notify:
     name: Notify Slack
     runs-on: ubuntu-latest
+    permissions:
+      contents: read
     needs: release
     if: needs.release.outputs.published == 'true'
 
EOF
@@ -98,6 +98,8 @@
notify:
name: Notify Slack
runs-on: ubuntu-latest
permissions:
contents: read
needs: release
if: needs.release.outputs.published == 'true'

Copilot is powered by AI and may make mistakes. Always verify output.
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,8 @@
"publish": "nx run-many -t build && changeset publish",
"publish:dry-run": "nx run-many -t build && changeset publish --dry-run",
"publish:no-build": "changeset publish",
"postinstall": "husky install"
"postinstall": "husky install",
"slack:notify": "node ./scripts/send-slack-notification.mjs"
},
"keywords": [
"nylas",
Expand Down Expand Up @@ -68,5 +69,8 @@
"nx": "21.5.2",
"oxlint": "^1.16.0",
"prettier": "^3.4.2"
},
"dependencies": {
"zx": "^7.2.3"
}
}
2 changes: 1 addition & 1 deletion packages/react/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@
"dependencies": {
"@nylas/connect": "workspace:^",
"@nylas/core": "^1.2.0",
"@nylas/web-elements": "2.3.0",
"@nylas/web-elements": "2.3.2",
"@stencil/react-output-target": "^1.2.0",
"axios": "^1.7.7",
"dayjs": "1.11.7",
Expand Down
Loading