Update trigger.yml #3
Workflow file for this run
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
# .github/workflows/security_inspection.yml | ||
name: Security Inspection with Microsoft Defender | ||
on: | ||
workflow_call: | ||
inputs: | ||
gh_environment: | ||
required: true | ||
type: string | ||
jobs: | ||
inspect: | ||
name: Inspect Code with Microsoft Defender for DevOps | ||
runs-on: ubuntu-latest | ||
environment: ${{ inputs.gh_environment }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v3 | ||
- name: Install Microsoft Defender for DevOps CLI | ||
run: | | ||
curl -sSL https://aka.ms/defender-install | bash | ||
- name: Run Microsoft Defender for DevOps | ||
run: | | ||
defender-scan --subscription-id ${{ secrets.AZURE_SUBSCRIPTION_ID }} \ | ||
--resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} \ | ||
--client-id ${{ secrets.AZURE_CLIENT_ID }} \ | ||
--tenant-id ${{ secrets.AZURE_TENANT_ID }} \ | ||
--client-secret ${{ secrets.AZURE_CLIENT_SECRET }} \ | ||
--repository $GITHUB_REPOSITORY \ | ||
--branch $GITHUB_REF_NAME | ||
- name: Upload Scan Results | ||
if: always() | ||
uses: actions/upload-artifact@v3 | ||
with: | ||
name: defender-scan-results | ||
path: ./defender-scan-results/ | ||
# steps: | ||
# - name: Checkout Code | ||
# uses: actions/checkout@v3 | ||
# - name: Set up Microsoft Defender for DevOps | ||
# run: | | ||
# echo "Setting up Microsoft Defender for DevOps..." | ||
# - name: Run Microsoft Defender for DevOps | ||
# run: | | ||
# # Replace with the actual command or script to run Microsoft Defender for DevOps | ||
# # Example: defender-scan or a script provided by Microsoft | ||
# defender-scan --subscription-id ${{ secrets.AZURE_SUBSCRIPTION_ID }} \ | ||
# --resource-group ${{ secrets.AZURE_RESOURCE_GROUP }} \ | ||
# --client-id ${{ secrets.AZURE_CLIENT_ID }} \ | ||
# --tenant-id ${{ secrets.AZURE_TENANT_ID }} \ | ||
# --client-secret ${{ secrets.AZURE_CLIENT_SECRET }} \ | ||
# --repository $GITHUB_REPOSITORY \ | ||
# --branch $GITHUB_REF_NAME | ||
# - name: Upload Scan Results | ||
# if: always() | ||
# uses: actions/upload-artifact@v3 | ||
# with: | ||
# name: defender-scan-results | ||
# path: ./defender-scan-results/ | ||