forked from Artemis1981-MBNN/login
-
Notifications
You must be signed in to change notification settings - Fork 1
Update pip3 to python3 -m pip format in workflow Co-authored-by: Jury1981 <210622247+Jury1981@users.noreply.github.com> #31
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
Open
Jury1981
wants to merge
6
commits into
master
Choose a base branch
from
copilot/connect-streamline-login-process
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
f3ea448
Merge pull request #3 from Jury1981/copilot/update-login-functionalit…
Jury1981 db74ff4
Initial plan
Copilot 8d2dc99
Add Azure Dev Container configuration with GNU utilities
Copilot 3ef699e
Add dev container examples and documentation
Copilot 82b8f92
Fix code review issues: heading hierarchy and cross-platform mount su…
Copilot e63d9d4
Update pip3 to python3 -m pip format in workflow
Copilot File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,112 @@ | ||
| # Example: Using Azure Login Action in Dev Containers | ||
|
|
||
| This example demonstrates how to use the Azure Login action in a GitHub Actions workflow | ||
| with dev containers for testing. | ||
|
|
||
| ## Basic Workflow with Dev Container | ||
|
|
||
| ```yaml | ||
| name: Test in Dev Container | ||
|
|
||
| on: [push, pull_request] | ||
|
|
||
| jobs: | ||
| test-in-devcontainer: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Build and run dev container | ||
| uses: devcontainers/ci@v0.3 | ||
| with: | ||
| runCmd: | | ||
| # The dev container has Azure CLI and PowerShell pre-installed | ||
| az version | ||
| pwsh -Command '$PSVersionTable' | ||
|
|
||
| # Run the build and test | ||
| npm run build | ||
| npm test | ||
|
|
||
| azure-login-test: | ||
| runs-on: ubuntu-latest | ||
| permissions: | ||
| id-token: write | ||
| contents: read | ||
|
|
||
| steps: | ||
| - name: Azure Login with OIDC | ||
| uses: azure/login@v2 | ||
| with: | ||
| client-id: ${{ secrets.AZURE_CLIENT_ID }} | ||
| tenant-id: ${{ secrets.AZURE_TENANT_ID }} | ||
| subscription-id: ${{ secrets.AZURE_SUBSCRIPTION_ID }} | ||
|
|
||
| - name: Run Azure CLI commands | ||
| run: | | ||
| az account show | ||
| az group list | ||
| ``` | ||
|
|
||
| ## Dev Container Testing Workflow | ||
|
|
||
| ```yaml | ||
| name: Dev Container Validation | ||
|
|
||
| on: | ||
| push: | ||
| paths: | ||
| - '.devcontainer/**' | ||
| - 'src/**' | ||
| pull_request: | ||
|
|
||
| jobs: | ||
| validate-devcontainer: | ||
| runs-on: ubuntu-latest | ||
|
|
||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v4 | ||
|
|
||
| - name: Test Dev Container | ||
| uses: devcontainers/ci@v0.3 | ||
| with: | ||
| runCmd: | | ||
| # Verify all tools are available | ||
| node --version | ||
| npm --version | ||
| az version | ||
| pwsh --version | ||
| gh --version | ||
|
|
||
| # Run development workflow | ||
| .devcontainer/dev.sh check | ||
| .devcontainer/dev.sh dev | ||
| ``` | ||
|
|
||
| ## Local Development | ||
|
|
||
| For local development, use the dev container directly: | ||
|
|
||
| 1. Open repository in VS Code | ||
| 2. Install the "Dev Containers" extension | ||
| 3. Click "Reopen in Container" | ||
| 4. Run commands: | ||
| ```bash | ||
| # Quick development workflow | ||
| .devcontainer/dev.sh dev | ||
|
|
||
| # Or manually | ||
| npm install | ||
| npm run build | ||
| npm test | ||
| ``` | ||
|
|
||
| ## Benefits | ||
|
|
||
| - **Consistent Environment**: Same tools across all developers and CI | ||
| - **Pre-configured Azure Tools**: Azure CLI and PowerShell ready to use | ||
| - **GNU Utilities**: Full Unix toolchain for scripting | ||
| - **Fast Setup**: No manual installation required |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,146 @@ | ||
| # Azure Login Action Dev Container | ||
|
|
||
| This development container provides a pre-configured environment for developing and testing the Azure Login GitHub Action. | ||
|
|
||
| ## What's Included | ||
|
|
||
| - **Node.js 20** - JavaScript/TypeScript runtime | ||
| - **Azure CLI** - Command-line tools for Azure | ||
| - **PowerShell** - Cross-platform PowerShell for Azure PowerShell module | ||
| - **GitHub CLI** - Command-line tools for GitHub | ||
| - **GNU Core Utilities** - Standard Unix tools (bash, grep, sed, etc.) | ||
| - **VS Code Extensions** - Azure and development tools | ||
|
|
||
| ## Quick Start | ||
|
|
||
| ### Using VS Code | ||
|
|
||
| 1. Install the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers) | ||
| 2. Open this repository in VS Code | ||
| 3. Click "Reopen in Container" when prompted (or use Command Palette: `Dev Containers: Reopen in Container`) | ||
| 4. Wait for the container to build and start | ||
|
|
||
| ### Using GitHub Codespaces | ||
|
|
||
| 1. Click the "Code" button on the GitHub repository | ||
| 2. Select "Codespaces" tab | ||
| 3. Click "Create codespace on main" (or your branch) | ||
|
|
||
| ## Features | ||
|
|
||
| ### Pre-installed Tools | ||
|
|
||
| - Azure CLI configured and ready to use | ||
| - PowerShell with support for Azure PowerShell modules | ||
| - All npm dependencies installed automatically | ||
| - GNU utilities for shell scripting and automation | ||
|
|
||
| ### Optimized for Development | ||
|
|
||
| - **Persistent Azure credentials** (optional): You can mount your `~/.azure` folder by adding this to `.devcontainer/devcontainer.json`: | ||
| ```json | ||
| "mounts": [ | ||
| "source=${localEnv:HOME}/.azure,target=/home/node/.azure,type=bind,consistency=cached" | ||
| ] | ||
| ``` | ||
| Note: This requires the `HOME` environment variable on your host system (Linux/Mac). Windows users should use `${localEnv:USERPROFILE}/.azure` instead. | ||
| - **Auto-install dependencies**: `npm install` runs automatically on container creation | ||
| - **Consistent environment**: Everyone uses the same tool versions | ||
|
|
||
| ### Environment Variables | ||
|
|
||
| - `AZURE_CORE_NO_COLOR=true` - Disables colored output for easier log parsing | ||
|
|
||
| ## Building and Testing | ||
|
|
||
| ### Using the Development Helper Script | ||
|
|
||
| The dev container includes a helper script that streamlines common tasks: | ||
|
|
||
| ```bash | ||
| # Run environment checks | ||
| .devcontainer/dev.sh check | ||
|
|
||
| # Quick development workflow (build + test) | ||
| .devcontainer/dev.sh dev | ||
|
|
||
| # Full setup (install dependencies + build) | ||
| .devcontainer/dev.sh setup | ||
|
|
||
| # Validate Azure configuration | ||
| .devcontainer/dev.sh validate | ||
|
|
||
| # View all available commands | ||
| .devcontainer/dev.sh help | ||
| ``` | ||
|
|
||
| ### Manual Commands | ||
|
|
||
| #### Build the Action | ||
|
|
||
| ```bash | ||
| npm run build | ||
| ``` | ||
|
|
||
| #### Run Tests | ||
|
|
||
| ```bash | ||
| npm test | ||
| ``` | ||
|
|
||
| #### Test Azure CLI | ||
|
|
||
| ```bash | ||
| az version | ||
| az login # If needed | ||
| az account show | ||
| ``` | ||
|
|
||
| #### Test PowerShell | ||
|
|
||
| ```bash | ||
| pwsh | ||
| # In PowerShell: | ||
| $PSVersionTable | ||
| Get-Command Connect-AzAccount | ||
| ``` | ||
|
|
||
| ## Streamlined Workflow | ||
|
|
||
| This dev container streamlines the development process by: | ||
|
|
||
| 1. **Eliminating setup time** - No need to install Azure CLI, PowerShell, or Node.js manually | ||
| 2. **Ensuring consistency** - All developers use the same tool versions | ||
| 3. **Simplifying Azure testing** - Azure CLI and PowerShell are pre-configured | ||
| 4. **Supporting GNU tools** - Full suite of Unix utilities for scripting and automation | ||
|
|
||
| ## Customization | ||
|
|
||
| To add more features, edit `.devcontainer/devcontainer.json` and add features from: | ||
| - [Dev Container Features](https://containers.dev/features) | ||
| - [Microsoft Features](https://github.com/devcontainers/features) | ||
|
|
||
| ## Troubleshooting | ||
|
|
||
| ### Azure credentials not persisting | ||
|
|
||
| By default, Azure credentials are not persisted between container rebuilds. To persist credentials: | ||
|
|
||
| 1. Add a mount configuration to `.devcontainer/devcontainer.json`: | ||
| - **Linux/Mac**: `"source=${localEnv:HOME}/.azure,target=/home/node/.azure,type=bind,consistency=cached"` | ||
| - **Windows**: `"source=${localEnv:USERPROFILE}/.azure,target=/home/node/.azure,type=bind,consistency=cached"` | ||
| 2. Make sure the `.azure` folder exists on your host machine before starting the container | ||
| 3. Rebuild the container | ||
|
|
||
| ### Container build fails | ||
|
|
||
| Try rebuilding without cache: | ||
| - VS Code: Command Palette → `Dev Containers: Rebuild Container Without Cache` | ||
| - CLI: `docker build --no-cache` | ||
|
|
||
| ### npm install fails | ||
|
|
||
| The container automatically runs `npm install` on creation. If it fails: | ||
| 1. Check your internet connection | ||
| 2. Rebuild the container | ||
| 3. Manually run `npm install` in the container terminal | ||
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
suggestion (typo): Consider using the plural "modules" for Azure PowerShell here.
This keeps the terminology consistent with your later reference to "Azure PowerShell modules."