This repository has been archived by the owner on Oct 5, 2023. It is now read-only.
Merge pull request #249 from Azure/bryanzab/US29807 #164
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: Convert Policy Definitions from BICEP to ARM | |
permissions: write-all | |
on: | |
push: | |
branches: | |
- "main" | |
workflow_dispatch: {} | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Generate token | |
id: generate_token | |
uses: tibdex/github-app-token@v1.8.0 | |
with: | |
app_id: ${{ secrets.APP_ID }} | |
private_key: ${{ secrets.APP_PRIVATE_KEY }} | |
- name: Set env.DATE environment variable | |
run: echo "DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV | |
- name: Create new branch | |
uses: peterjgrainger/action-create-branch@v2.4.0 | |
env: | |
GITHUB_TOKEN: ${{ steps.generate_token.outputs.token }} | |
with: | |
branch: "arm-conversion-${{ env.DATE }}" | |
- name: Checkout Repo | |
uses: actions/checkout@v3 | |
- name: Run Bicep build | |
uses: aliencube/bicep-build-actions@v0.3.255 | |
with: | |
files: "src/resources/Microsoft.Authorization/policyDefinitions/*.bicep" | |
- name: Commit & Push | |
uses: actions-js/push@master | |
with: | |
github_token: ${{ steps.generate_token.outputs.token }} | |
branch: "arm-conversion-${{ env.DATE }}" | |
force: true | |
message: "BICEP to ARM automatic conversion by Github Actions - update-${{ env.DATE }}" | |
- name: Pull request | |
uses: devops-infra/action-pull-request@v0.5.5 | |
with: | |
github_token: ${{ steps.generate_token.outputs.token }} | |
source_branch: "arm-conversion-${{ env.DATE }}" | |
target_branch: main | |
title: "BICEP to ARM automatic conversion by Github Actions - update-${{ env.DATE }}" |