-
Notifications
You must be signed in to change notification settings - Fork 21
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
ci(workflow): fix set-env job (checkout + token) #658
Conversation
WalkthroughThe pull request modifies the Changes
Possibly related PRs
Suggested reviewers
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Codecov ReportAll modified and coverable lines are covered by tests ✅ |
size-limit report 📦
|
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.
Actionable comments posted: 0
🧹 Outside diff range and nitpick comments (1)
.github/workflows/notify-release.yml (1)
Line range hint
44-49
: Add error handling for GitHub CLI commands.The release view command could fail silently if the tag doesn't exist or if there are API issues. Consider adding error handling:
- name: Extract changelog for tag run: | + set -e # Exit on any error { echo 'CHANGELOG<<EOF' - gh release view ${{ needs.set-env.outputs.tag }} --json body -q '.body' + if ! gh release view ${{ needs.set-env.outputs.tag }} --json body -q '.body'; then + echo "::error::Failed to fetch release information for tag ${{ needs.set-env.outputs.tag }}" + exit 1 + fi echo 'EOF' } >> "$GITHUB_ENV" env: GH_TOKEN: ${{ secrets.OPS_TOKEN }}🧰 Tools
🪛 actionlint
24-24: shellcheck reported issue in this script: SC2086:info:6:20: Double quote to prevent globbing and word splitting
(shellcheck)
24-24: shellcheck reported issue in this script: SC2295:info:8:31: Expansions inside ${..} need to be quoted separately, otherwise they match as patterns
(shellcheck)
24-24: shellcheck reported issue in this script: SC2086:info:9:32: Double quote to prevent globbing and word splitting
(shellcheck)
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
📒 Files selected for processing (1)
.github/workflows/notify-release.yml
(2 hunks)
🔇 Additional comments (2)
.github/workflows/notify-release.yml (2)
19-21
: LGTM! Improved workflow reliability with proper checkout and authentication.
The changes correctly address two important aspects:
- Added repository checkout using the latest actions/checkout@v4
- Added proper authentication using OPS_TOKEN for GitHub API access
Also applies to: 36-36
36-36
: Verify OPS_TOKEN permissions across repositories.
The OPS_TOKEN is used for cross-repository operations. Ensure it has the minimum required permissions:
- Read access to releases and contents
- Write access to discussions
- Workflow dispatch permissions for docs and schema repositories
Also applies to: 36-36
✅ Verification successful
OPS_TOKEN permissions are properly configured.
The OPS_TOKEN has access to the required repositories, and discussions are disabled where applicable.
🏁 Scripts executed
The following scripts were executed for the analysis:
Script:
#!/bin/bash
# Description: Verify the repositories and required permissions
# Check if the token has access to the required repositories
for repo in "axone-protocol/docs" "axone-protocol/axone-contract-schema"; do
echo "Checking access to $repo..."
gh api "/repos/$repo" --silent || echo "No access to $repo"
done
# Check if discussions are enabled in the target repository
gh api graphql -f query='
query($owner: String!, $name: String!) {
repository(owner: $owner, name: $name) {
hasDiscussionsEnabled
discussionCategories(first: 10) {
nodes {
id
name
}
}
}
}' -f owner='axone-protocol' -f name='contracts'
Length of output: 867
Self explanatory.
(same than axone-protocol/axoned#814)
Summary by CodeRabbit