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

Set --source-control-url on push #86

Merged
merged 3 commits into from
Jan 29, 2025
Merged

Conversation

nicksnyder
Copy link
Member

This ensures push will work on enterprise GitHub instances that have arbitrary URLs.

@nicksnyder
Copy link
Member Author

@doriable @emcfarlane I have not actually tested this. Please test and takeover this PR to make any changes necessary.

// We want push to succeed without additional user configuration even if the action is being run on an
// enterprise GitHub instance. Because enterprise GitHub instances can have an arbitrary URL, the Buf CLI with not be
// able to automatically detect the source control url, so we set it explicitly.
const sourceControlUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/commit/${context.sha}`;
Copy link
Member Author

Choose a reason for hiding this comment

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

Could have tried to make this conditional and only set this if we are on an enterprise instance, but it seems better/simpler to always set it and ensure it works everywhere instead of having multiple code paths.

@nicksnyder nicksnyder changed the title Always set --source-control-url on push Set --source-control-url on push Jan 29, 2025

This comment has been minimized.

Copy link
Collaborator

@emcfarlane emcfarlane left a comment

Choose a reason for hiding this comment

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

Looks good to me.

@nicksnyder nicksnyder merged commit c536ef2 into main Jan 29, 2025
36 checks passed
@nicksnyder nicksnyder deleted the support-github-enterprise branch January 29, 2025 01:21
@emcfarlane emcfarlane mentioned this pull request Jan 29, 2025
emcfarlane added a commit that referenced this pull request Jan 29, 2025
Below is the draft release notes:

## What's Changed
* Add migration guide doc by @emcfarlane in
#74
* Set --debug when the action is using debug logging by @emcfarlane in
#78
* Set --source-control-url on push so that the push action now works by
default on enterprise GitHub instances by @nicksnyder in
#86

## New Contributors
* @doriable made their first contribution in
#98

**Full Changelog**:
v1.0.2...v1.0.3
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.

3 participants