Sa 3607 gha ci workflow km #75
This file contains 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
name: PowerShell Module CI | |
on: | |
pull_request: | |
branches: | |
- 'JumpCloudModule_**' | |
jobs: | |
check-changes: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Check Changes in Folder | |
run: | | |
# Define the path to the specific folder you want to check | |
SPECIFIC_FOLDER="Powershell/JumpCloud Module" | |
# Check for changes in the specific folder | |
git fetch origin $GITHUB_BASE_REF | |
CHANGED_FILES=$(git diff origin/$GITHUB_BASE_REF..HEAD) | |
# Output Head and Base | |
echo "Head: $GITHUB_HEAD_REF" | |
echo "Base: $GITHUB_BASE_REF" | |
if [ -n "$CHANGED_FILES" ]; then | |
echo "Changes detected in the specified folder: $CHANGED_FILES" | |
else | |
echo "No changes detected in the specified folder. Exiting..." | |
exit 0 # Exit the workflow with a success status code | |
fi | |
clone: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 1 | |
Publish-PowerShell-Artifact: | |
runs-on: ubuntu-latest | |
timeout-minutes: 30 | |
env: | |
Source: "CodeArtifact" | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
sparse-checkout: | | |
PowerShell | |
- shell: pwsh | |
run: | | |
. "./PowerShell/Deploy/BuildNuspecFromPsd1.ps1" -RequiredModulesRepo PSGallery |