Skip to content
Open
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
10 changes: 10 additions & 0 deletions .craft.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
github:
owner: getsentry
repo: sentry-go
changelogPolicy: simple
targets:
- name: github
- name: registry
type: sdk
config:
canonical: 'github:getsentry/sentry-zig'
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Bug: Registry Reference Mismatch Causes Tooling Issues

The canonical registry reference points to sentry-zig, but the github configuration specifies sentry-go. This inconsistency could cause release tooling to interact with or publish to the wrong repository.

Fix in Cursor Fix in Web

32 changes: 32 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Prepare Release
on:
workflow_dispatch:
inputs:
version:
description: Version to release
required: true
force:
description: Force a release even when there are release-blockers (optional)
required: false
jobs:
release:
runs-on: ubuntu-latest
name: "Release a new version"
steps:
- name: Get auth token
id: token
uses: actions/create-github-app-token@df432ceedc7162793a195dd1713ff69aefc7379e # v2.0.6
with:
app-id: ${{ vars.SENTRY_RELEASE_BOT_CLIENT_ID }}
private-key: ${{ secrets.SENTRY_RELEASE_BOT_PRIVATE_KEY }}
- uses: actions/checkout@v4
with:
token: ${{ steps.token.outputs.token }}
fetch-depth: 0
- name: Prepare release
uses: getsentry/action-prepare-release@v1
env:
GITHUB_TOKEN: ${{ steps.token.outputs.token }}
with:
version: ${{ github.event.inputs.version }}
force: ${{ github.event.inputs.force }}
Comment on lines +13 to +32

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 months ago

To fix the problem, we should add a permissions block to the workflow. The best way is to add it at the top level (just below the name: and before on:), so it applies to all jobs unless overridden. The minimal starting point is contents: read, but since the workflow checks out code and prepares releases (which may involve creating tags, releases, or modifying pull requests), we should ensure the permissions are sufficient for these actions. However, unless the workflow specifically needs to write to contents or pull requests, starting with contents: read is safest. If errors occur due to insufficient permissions, the block can be expanded. For now, add:

permissions:
  contents: read

directly after the name: line in .github/workflows/release.yml.

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
@@ -1,3 +1,5 @@
+permissions:
+  contents: read
 name: Prepare Release
 on:
   workflow_dispatch:
EOF
@@ -1,3 +1,5 @@
permissions:
contents: read
name: Prepare Release
on:
workflow_dispatch:
Copilot is powered by AI and may make mistakes. Always verify output.
Loading