Skip to content

Add action to update vscode extension with latest version #394

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

Merged
merged 1 commit into from
May 31, 2024

Conversation

emmawillis
Copy link
Contributor

@emmawillis emmawillis commented May 31, 2024

the extension calls cliUtils.loadCli() when it activates, which downloads the CLI based on the version defined in constants.ts, so i think it should be sufficient just to update the version defined there

I set this to only run if the version bump is minor or patch

tested: DevCycleHQ/vscode-extension#291

Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

Hey @emmawillis - I've reviewed your changes and found some issues that need to be addressed.

Blocking issues:

  • Use inputs.latest_tag instead of $LATEST_TAG (link)
Here's what I looked at during the review
  • 🔴 General issues: 1 blocking issue, 1 other issue
  • 🟢 Security: all looks good
  • 🟢 Testing: all looks good
  • 🟢 Complexity: all looks good

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment to tell me if it was helpful.

working-directory: vscode-extension
env:
GH_TOKEN: ${{ inputs.access_token }}
run: gh pr create --repo DevCycleHQ/vscode-extension --base main --head "$BRANCH_NAME" --title "Update CLI version to $LATEST_TAG" --body "This PR was automatically created by the DevCycle CLI release workflow."
Copy link

Choose a reason for hiding this comment

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

issue (bug_risk): Use inputs.latest_tag instead of $LATEST_TAG

The variable $LATEST_TAG is not defined in this context. It should be replaced with ${{ inputs.latest_tag }} to ensure the correct value is used.

- name: Push code to extension repo
shell: bash
working-directory: vscode-extension
run: git push --set-upstream origin "$BRANCH_NAME"
Copy link

Choose a reason for hiding this comment

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

suggestion: Consider adding error handling for git push

Adding error handling for the git push command can help catch and handle any issues that might occur during the push operation, ensuring the workflow does not fail silently.

Suggested change
run: git push --set-upstream origin "$BRANCH_NAME"
run: |
set -e
git push --set-upstream origin "$BRANCH_NAME" || {
echo "Error: Failed to push code to the repository."
exit 1
}

@emmawillis emmawillis force-pushed the update-vscode-version branch from bf18c6f to a401a1d Compare May 31, 2024 16:33
@emmawillis emmawillis marked this pull request as draft May 31, 2024 16:34
@emmawillis emmawillis force-pushed the update-vscode-version branch 5 times, most recently from 1f0554c to 03043c8 Compare May 31, 2024 16:52
@emmawillis emmawillis force-pushed the update-vscode-version branch from 03043c8 to 471eed0 Compare May 31, 2024 17:02
@emmawillis emmawillis marked this pull request as ready for review May 31, 2024 17:02
Copy link

@sourcery-ai sourcery-ai bot left a comment

Choose a reason for hiding this comment

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

We have skipped reviewing this pull request. It looks like we've already reviewed this pull request.

@emmawillis emmawillis merged commit 2259f44 into main May 31, 2024
1 check passed
@emmawillis emmawillis deleted the update-vscode-version branch May 31, 2024 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

2 participants