-
Notifications
You must be signed in to change notification settings - Fork 97
fix: Using wrong branch when creating release #7317
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
Conversation
📝 WalkthroughWalkthroughThe changes update two files: a GitHub Actions workflow now checks out the base branch instead of the head branch during release creation, and a shell script now uses the current working directory instead of the script's directory for its operations. No other logic or exported entities were modified. Changes
Suggested labels
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
SupportNeed help? Create a ticket on our support page for assistance with any issues or questions. 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
Documentation and Community
|
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.
Pull Request Overview
This PR corrects branch references when creating a release by adjusting script directory resolution and checkout parameters.
- Simplify
mydir
assignment in the download script. - Change the checkout
ref
in the release workflow to usebase_branch
instead ofhead_branch
.
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
File | Description |
---|---|
scripts/download-workflow-binaries.sh | Switched mydir from script’s directory to current working dir |
.github/workflows/create-release.yaml | Updated checkout ref input from head_branch to base_branch |
Comments suppressed due to low confidence (2)
.github/workflows/create-release.yaml:38
- Ensure that
inputs.base_branch
is declared in the workflow’sinputs
section; otherwise this checkout step will fail. If it’s not defined, add abase_branch
input or provide a default.
ref: ${{ inputs.base_branch }}
scripts/download-workflow-binaries.sh:22
- Reverting to
pwd -P
may break relative path resolution when the script is run from outside its directory. Consider restoring the previous logic using${BASH_SOURCE[0]}
to consistently point at the script’s location.
mydir=$(pwd -P)
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
🧹 Nitpick comments (1)
scripts/download-workflow-binaries.sh (1)
20-23
: Use repo root instead of$PWD
to make the script location-agnostic
pwd -P
only works when the caller’s working directory is the repository root (as is the case increate-release.yaml
).
If someone runs this helper from a sub-directory the paths defined later (dist/...
) will be created in the wrong place.-mydir=$(pwd -P) +mydir=$(git rev-parse --show-toplevel)
git rev-parse --show-toplevel
is cheap, resolves symlinks, and always returns the repository root, keeping the script robust no matter where it is invoked from.
📜 Review details
Configuration used: .coderabbit.yaml
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (2)
.github/workflows/create-release.yaml
(1 hunks)scripts/download-workflow-binaries.sh
(1 hunks)
🧰 Additional context used
🧠 Learnings (3)
📓 Common learnings
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7280
File: .github/workflows/checks-pre-commit.yaml:30-36
Timestamp: 2025-07-01T13:09:08.718Z
Learning: In the hoprnet repository's GitHub Actions workflow architecture, ausias-armesto prefers to centralize input resolution and fallback logic in the main checks.yaml workflow, which then calls individual reusable workflows like checks-pre-commit.yaml. The individual workflows are designed to be called primarily through the main workflow rather than directly, so fallback values in the individual workflows may be considered redundant.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6886
File: nix/rust-package.nix:84-84
Timestamp: 2025-02-25T00:35:33.437Z
Learning: When transitioning from vendored dependencies to a private proxy registry in Rust projects, GitHub Actions workflows need to be refactored to accommodate the new update strategy, particularly workflows handling dependency updates like renovate-cargo-update.yaml.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:61-97
Timestamp: 2024-11-26T17:47:32.384Z
Learning: The code in the 'Set environment variables' step in `.github/workflows/build-binaries.yaml` is obsolete and should not be reviewed in future code reviews.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github.event_name context may inherit from the parent workflow rather than being set to 'workflow_call', allowing conditions like 'github.event_name == 'pull_request'' to work correctly when the parent workflow was triggered by a pull_request event.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-10-09T06:16:18.170Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: tolbrino
PR: hoprnet/hoprnet#6502
File: flake.nix:12-14
Timestamp: 2024-09-30T08:27:16.849Z
Learning: The project already has CI workflows that automatically check for compatibility issues when updating dependencies, including compiling smart contracts with new Solidity versions, running the test suite, checking for compiler warnings or deprecation notices, and reviewing changelogs for breaking changes.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:0-0
Timestamp: 2024-11-26T17:47:21.777Z
Learning: In `.github/workflows/build-binaries.yaml`, when writing shell scripts in GitHub Actions workflows, the user prefers to set environment variables individually rather than grouping them together.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6379
File: .github/scripts/immutable-files-check.sh:1-1
Timestamp: 2024-07-11T12:39:43.940Z
Learning: The `git diff --name-only HEAD` command is used to check for changes between the working directory and the last commit, which is appropriate for preventing committed changes.
Learnt from: Teebor-Choka
PR: hoprnet/hoprnet#6379
File: .github/scripts/immutable-files-check.sh:1-1
Timestamp: 2024-10-09T06:16:23.638Z
Learning: The `git diff --name-only HEAD` command is used to check for changes between the working directory and the last commit, which is appropriate for preventing committed changes.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:08:43.091Z
Learning: In GitHub Actions reusable workflows, the github context from the caller workflow is inherited by the called workflow, so github.event_name reflects the original triggering event (e.g., 'pull_request') rather than being set to 'workflow_call'. Conditions like 'github.event_name == 'pull_request'' work correctly in reusable workflows when the parent workflow was triggered by that event type.
.github/workflows/create-release.yaml (3)
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7280
File: .github/workflows/checks-pre-commit.yaml:30-36
Timestamp: 2025-07-01T13:09:08.718Z
Learning: In the hoprnet repository's GitHub Actions workflow architecture, ausias-armesto prefers to centralize input resolution and fallback logic in the main checks.yaml workflow, which then calls individual reusable workflows like checks-pre-commit.yaml. The individual workflows are designed to be called primarily through the main workflow rather than directly, so fallback values in the individual workflows may be considered redundant.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7251
File: .github/workflows/package.yaml:28-28
Timestamp: 2025-06-19T10:07:29.649Z
Learning: In GitHub Actions reusable workflows, the github.event_name context may inherit from the parent workflow rather than being set to 'workflow_call', allowing conditions like 'github.event_name == 'pull_request'' to work correctly when the parent workflow was triggered by a pull_request event.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:61-97
Timestamp: 2024-11-26T17:47:32.384Z
Learning: The code in the 'Set environment variables' step in `.github/workflows/build-binaries.yaml` is obsolete and should not be reviewed in future code reviews.
scripts/download-workflow-binaries.sh (5)
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:61-97
Timestamp: 2024-11-26T17:47:32.384Z
Learning: The code in the 'Set environment variables' step in `.github/workflows/build-binaries.yaml` is obsolete and should not be reviewed in future code reviews.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#6681
File: .github/workflows/build-binaries.yaml:0-0
Timestamp: 2024-11-26T17:47:21.777Z
Learning: In `.github/workflows/build-binaries.yaml`, when writing shell scripts in GitHub Actions workflows, the user prefers to set environment variables individually rather than grouping them together.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7297
File: scripts/download-workflow-binaries.sh:0-0
Timestamp: 2025-07-11T09:09:56.528Z
Learning: In the hoprnet repository, each ZIP artifact downloaded by scripts/download-workflow-binaries.sh contains only a single file with the same name as the artifact. This means there's no risk of file collisions when extracting multiple ZIP files into a shared directory, as each artifact produces only one uniquely named file.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7191
File: .github/workflows/open-pr.yaml:83-95
Timestamp: 2025-06-30T08:36:01.731Z
Learning: The self-hosted-hoprnet-small runners in the hoprnet repository have GitHub CLI (gh) pre-installed and available for use in workflows.
Learnt from: ausias-armesto
PR: hoprnet/hoprnet#7280
File: .github/workflows/checks-pre-commit.yaml:30-36
Timestamp: 2025-07-01T13:09:08.718Z
Learning: In the hoprnet repository's GitHub Actions workflow architecture, ausias-armesto prefers to centralize input resolution and fallback logic in the main checks.yaml workflow, which then calls individual reusable workflows like checks-pre-commit.yaml. The individual workflows are designed to be called primarily through the main workflow rather than directly, so fallback values in the individual workflows may be considered redundant.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (6)
- GitHub Check: hoprd / docker
- GitHub Check: hopli / docker
- GitHub Check: Pre-commit / Pre-commit
- GitHub Check: Zizmor / Zizmor
- GitHub Check: Lint / Lint
- GitHub Check: Audit / Audit
🔇 Additional comments (1)
.github/workflows/create-release.yaml (1)
38-38
: Checkout onbase_branch
looks correct – double-check release version lives thereSwitching the checkout ref to
${{ inputs.base_branch }}
prevents releases from being built off un-merged PR code. 👍
Please ensure that the version bump commit (read byget-current-version.sh
) is guaranteed to be present on the base branch before this workflow runs, otherwise the tag step will reference an outdated commit.
Uh oh!
There was an error while loading. Please reload this page.