Schemas #95
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
# | |
# Sync PSRule schemas | |
# | |
# NOTES: | |
# Autoamtically bump PSRule schemas. | |
name: Schemas | |
on: | |
schedule: | |
- cron: '0 0 * * 1' # At 12:00 AM, only on Monday | |
workflow_dispatch: {} | |
permissions: {} | |
env: | |
WORKING_BRANCH: dependencies/schema-bump | |
DOTNET_NOLOGO: true | |
DOTNET_CLI_TELEMETRY_OPTOUT: true | |
jobs: | |
sync: | |
name: Bump schemas | |
runs-on: ubuntu-latest | |
if: github.repository == 'microsoft/PSRule-vscode' | |
permissions: | |
contents: write | |
pull-requests: write | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: Checkout PSRule | |
uses: actions/checkout@v3 | |
with: | |
repository: microsoft/PSRule | |
path: PSRule | |
- name: Configure | |
run: | | |
git config user.name github-actions | |
git config user.email '41898282+github-actions[bot]@users.noreply.github.com' | |
- name: Get working branch | |
run: | | |
git checkout -B ${{ env.WORKING_BRANCH }} --force | |
- name: Copy Schemas | |
run: | | |
Import-Module ./scripts/schemas.psm1; | |
Update-Schemas -Path ./PSRule/schemas/; | |
shell: pwsh | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |