Skip to content
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) #814

Merged
merged 1 commit into from
Nov 13, 2024
Merged

Conversation

ccamel
Copy link
Member

@ccamel ccamel commented Nov 13, 2024

Self explanatory.

Summary by CodeRabbit

  • New Features

    • Enhanced release notification process with improved environment variable management.
    • Added a new job to streamline repository checkout and environment setup.
    • Updated discussion announcements for releases to include links and social media integration.
  • Improvements

    • Optimized logic for determining release tags, ensuring accurate retrieval of the latest tag.

@ccamel ccamel self-assigned this Nov 13, 2024
@ccamel ccamel marked this pull request as ready for review November 13, 2024 10:40
Copy link
Contributor

coderabbitai bot commented Nov 13, 2024

Walkthrough

The pull request introduces modifications to the .github/workflows/notify-release.yml file, enhancing the release notification process. A new job, set-env, is added to set environment variables and check out the repository. The logic for determining the release tag is updated to utilize the GitHub CLI. The notify-github-discussion job is also modified to include repository checkout and environment variable usage. Other jobs related to documentation updates remain unchanged but continue to function based on the release tag.

Changes

File Change Summary
.github/workflows/notify-release.yml - Added job: set-env for environment variable setup and repository checkout.
- Modified job: notify-github-discussion to include actions/checkout@v4.
- Updated logic for determining release tag using GitHub CLI.
- Added environment variable: GH_TOKEN for both set-env and notify-github-discussion jobs.

Possibly related PRs

  • Ci/notify discussions release #787: The changes in this PR also modify the .github/workflows/notify-release.yml file, specifically focusing on the set-env job and the notify-github-discussion job, which are directly related to the enhancements made in the main PR regarding environment variable handling and release notification processes.

Suggested reviewers

  • bdeneux
  • amimart
  • AnjaMis

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?

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Generate unit testing code for this file.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai generate unit testing code for this file.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and generate unit testing code.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

codecov bot commented Nov 13, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #814      +/-   ##
==========================================
+ Coverage   42.68%   42.98%   +0.30%     
==========================================
  Files         112      113       +1     
  Lines        6281     6325      +44     
==========================================
+ Hits         2681     2719      +38     
- Misses       3476     3480       +4     
- Partials      124      126       +2     

see 1 file with indirect coverage changes

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Outside diff range and nitpick comments (2)
.github/workflows/notify-release.yml (2)

Line range hint 64-73: Add error handling for optional environment variables

The announcement template uses environment variables for social links without checking their existence. Consider adding conditional checks to prevent empty or malformed links.

            # Resources

            📄 Changelog: <https://github.com/${{ github.repository }}/releases/tag/${{ needs.set-env.outputs.tag }}>
            🛠️ Official repo: <https://github.com/${{ github.repository }}>
-            💬 Vibe with us on Discord: <${{ env.DISCORD_URL }}>
-            🐦 Catch us on Twitter: <${{ env.TWITTER_URL }}>
+            ${{ env.DISCORD_URL && format('💬 Vibe with us on Discord: <{0}>', env.DISCORD_URL) }}
+            ${{ env.TWITTER_URL && format('🐦 Catch us on Twitter: <{0}>', env.TWITTER_URL) }}
🧰 Tools
🪛 actionlint

23-23: shellcheck reported issue in this script: SC2086:info:6:20: Double quote to prevent globbing and word splitting

(shellcheck)


23-23: shellcheck reported issue in this script: SC2295:info:8:31: Expansions inside ${..} need to be quoted separately, otherwise they match as patterns

(shellcheck)


23-23: shellcheck reported issue in this script: SC2086:info:9:32: Double quote to prevent globbing and word splitting

(shellcheck)


Line range hint 89-156: Consider reducing configuration duplication in documentation update jobs

The documentation update jobs contain repeated configuration patterns. Consider using a matrix strategy to reduce duplication and improve maintainability.

  update-docs:
    runs-on: ubuntu-22.04
    if: github.event_name != 'workflow_dispatch'
    strategy:
      matrix:
        docs:
          - {section: "modules", directory: "docs/proto/*"}
          - {section: "commands", directory: "docs/command/*"}
          - {section: "predicates", directory: "docs/predicate/*"}
    steps:
      - name: Update ${{ matrix.docs.section }} docs
        uses: fjogeleit/http-request-action@v1
        with:
          url: "https://api.github.com/repos/axone-protocol/docs/actions/workflows/39152549/dispatches"
          method: "POST"
          customHeaders: '{"Accept": "application/vnd.github+json", "Authorization": "Bearer ${{ secrets.OPS_TOKEN }}"}'
          data: |-
            {
              "ref": "main",
              "inputs": {
                "version": "${{ github.event.release.tag_name }}",
                "repository": "${{github.repository}}",
                "section": "${{ matrix.docs.section }}",
                "docs_directory": "${{ matrix.docs.directory }}"
              }
            }
🧰 Tools
🪛 actionlint

23-23: shellcheck reported issue in this script: SC2086:info:6:20: Double quote to prevent globbing and word splitting

(shellcheck)


23-23: shellcheck reported issue in this script: SC2295:info:8:31: Expansions inside ${..} need to be quoted separately, otherwise they match as patterns

(shellcheck)


23-23: shellcheck reported issue in this script: SC2086:info:9:32: Double quote to prevent globbing and word splitting

(shellcheck)

📜 Review details

Configuration used: .coderabbit.yaml
Review profile: CHILL

📥 Commits

Reviewing files that changed from the base of the PR and between 6d15242 and 767fcb4.

📒 Files selected for processing (1)
  • .github/workflows/notify-release.yml (2 hunks)
🔇 Additional comments (2)
.github/workflows/notify-release.yml (2)

18-20: LGTM: Repository checkout configuration is appropriate

The checkout action is correctly configured using the latest stable version (v4) and is appropriately placed before repository access operations.


Line range hint 1-17: LGTM: Workflow structure is well-organized

The workflow configuration demonstrates good practices:

  • Clear job dependencies and execution flow
  • Appropriate conditional execution
  • Proper use of environment variables and secrets
🧰 Tools
🪛 actionlint

23-23: shellcheck reported issue in this script: SC2086:info:6:20: Double quote to prevent globbing and word splitting

(shellcheck)


23-23: shellcheck reported issue in this script: SC2295:info:8:31: Expansions inside ${..} need to be quoted separately, otherwise they match as patterns

(shellcheck)


23-23: shellcheck reported issue in this script: SC2086:info:9:32: Double quote to prevent globbing and word splitting

(shellcheck)

.github/workflows/notify-release.yml Show resolved Hide resolved
@ccamel
Copy link
Member Author

ccamel commented Nov 13, 2024

@coderabbitai resolve

Copy link
Contributor

coderabbitai bot commented Nov 13, 2024

✅ Actions performed

Comments resolved and changes approved.

@ccamel ccamel merged commit 27e873d into main Nov 13, 2024
21 checks passed
@ccamel ccamel deleted the ci/fix-notify-release branch November 13, 2024 11:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant