-
Notifications
You must be signed in to change notification settings - Fork 18
ci: test npm trusted publishing on every push #2814
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,12 +1,9 @@ | ||
| name: NPM Packages Release | ||
| on: | ||
| push: | ||
| branches: | ||
| - main | ||
| on: [push] | ||
| jobs: | ||
| release: | ||
| # skip this job if the commit was created by this workflow (prevents infinite loop) | ||
| if: ${{ github.ref == 'refs/heads/main' && !startsWith(github.event.head_commit.message, 'NPM Package Release') }} | ||
| if: ${{ !startsWith(github.event.head_commit.message, 'NPM Package Release') }} | ||
|
Comment on lines
+2
to
+6
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🔒 Security & Privacy | 🟠 Major | ⚡ Quick win 🧩 Analysis chain🏁 Script executed: #!/bin/bash
set -euo pipefail
# Map the workflow structure first.
ast-grep outline .github/workflows/npm-package-release.yml --view expanded || true
# Read the relevant top section and the release job permissions/guards.
sed -n '1,120p' .github/workflows/npm-package-release.yml
# Find references to branch/ref filters, permissions, and release-related push operations.
rg -n "refs/heads|refs/tags|permissions:|id-token: write|contents: write|NPM Package Release|push:" .github/workflows/npm-package-release.ymlRepository: rainlanguage/raindex Length of output: 6371 Keep the release job off arbitrary branches. 🤖 Prompt for AI AgentsSource: MCP tools |
||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
|
|
@@ -275,11 +272,3 @@ jobs: | |
| ui_components_npm_package_${{ env.UC_NEW_VERSION }}.tgz | ||
| env: | ||
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| # forwards status to telegram chat if this ci fails or gets canceled, only runs for default branch | ||
| - name: Forward CI Status | ||
| if: always() | ||
| uses: rainlanguage/github-chore/.github/actions/telegram-status-report@main | ||
| with: | ||
| status: ${{ job.status }} | ||
| telegram-bot-token: ${{ secrets.TELEGRAM_BOT_TOKEN }} | ||
| telegram-chat-id: ${{ secrets.TELEGRAM_CHAT_ID }} | ||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
🗄️ Data Integrity & Integration | 🟠 Major | ⚡ Quick win
🧩 Analysis chain
🏁 Script executed:
Repository: rainlanguage/raindex
Length of output: 304
🏁 Script executed:
Repository: rainlanguage/raindex
Length of output: 17325
Exclude tag pushes from
.github/workflows/npm-package-release.yml:2.on: [push]also runs for tag pushes, and this job publishes before the latergit push/release steps. On a detached tag ref, that can leave npm packages published without the matching commit/tag updates; use a branch-only push filter such ason: { push: { branches: ['**'] } }.🤖 Prompt for AI Agents
Source: MCP tools