Skip to content

Poll Starter Workflows #2014

Poll Starter Workflows

Poll Starter Workflows #2014

name: Poll Starter Workflows
on:
schedule:
- cron: "0 */6 * * *"
workflow_dispatch:
env:
STARTER_WORKFLOW_PATH: "./resources/yaml/"
STARTER_WORKFLOW_REPO_BRANCH: "main"
jobs:
poll:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Download starter workflows
run: |
# get deployment workflows
echo "Calling GitHub API for starter workflows"
curl \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/actions/starter-workflows/contents/deployments?ref=$STARTER_WORKFLOW_REPO_BRANCH \
| jq -c '.[]' | while read -r workflow;
do
# extract fields
name=$(echo $workflow | jq '.name' -r)
downloadUrl=$(echo $workflow | jq '.download_url' -r)
sha=$(echo $workflow | jq '.sha' -r)
# download workflow if it's an AKS workflow
echo "Checking workflow $name"
if [[ ( $name == azure-kubernetes-service* ) ]] ;
then
echo "Downloading starter workflow $name"
mkdir -p $STARTER_WORKFLOW_PATH && touch $STARTER_WORKFLOW_PATH$name
wget -O $STARTER_WORKFLOW_PATH$name $downloadUrl
fi
done
- name: Create Pull Request
uses: peter-evans/create-pull-request@v4
with:
commit-message: update starter workflows
title: Automated Update Starter Workflows
body: This is an auto-generated PR. The starter workflow repo has changes not in this repository. Closing this PR stops all future alerts for these particular file changes.
branch: starter-workflow-updates