Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/scripts/tests/update-packages.test.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,13 @@ def shell(name):


class UpdatePackagesTests(unittest.TestCase):
def test_setup_installs_caller_sdk_pin_without_changing_selection_policy(self):
setup = STEPS["Setup .NET"]
self.assertIn("dotnet-version: ${{ env.DOTNET_VERSION }}", setup)
self.assertIn("global-json-file: ${{ hashFiles('global.json') != '' && 'global.json' || '' }}", setup)
self.assertIn("DOTNET_INSTALL_DIR:", setup)
self.assertNotRegex(SOURCE, r"(?:rm|mv|sed|jq) .*global[.]json")

def setUp(self):
self.temp = tempfile.TemporaryDirectory(prefix="update-packages-")
self.addCleanup(self.temp.cleanup)
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/update-packages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,10 @@ jobs:
DOTNET_INSTALL_DIR: ${{ runner.environment == 'self-hosted' && format('{0}/dotnet', runner.temp) || '' }}
with:
dotnet-version: ${{ env.DOTNET_VERSION }}
# setup-dotnet installs both versions when both inputs are present. The
# latest SDK alone cannot satisfy an exact pin or an older feature band.
# Keep the caller's roll-forward policy; never rewrite global.json.
global-json-file: ${{ hashFiles('global.json') != '' && 'global.json' || '' }}

- name: Setup Node.js
if: steps.detect.outputs.update_npm == 'true'
Expand Down
Loading