Skip to content

Enable workflows

Enable workflows #3

name: Enable workflows
on:
workflow_dispatch:
schedule:
- cron: '0 2 1 * *'
jobs:
enable-workflows:
runs-on: ubuntu-22.04
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: main
fetch-depth: 0
- name: Get branches to enable
run: |
git branch -r | grep -E '.+/.+/.+' | grep -v HEAD | sed 's/origin\///' > repo_list
- name: Enable workflows
run: |
while read line; do
curl --fail-with-body -X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.TOKEN_KEYS }}" \
https://api.github.com/repos/$line/actions/workflows/pkgdown.yaml/enable
curl --fail-with-body -X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.TOKEN_KEYS }}" \
https://api.github.com/repos/$line/actions/workflows/R-CMD-check.yaml/enable
curl --fail-with-body -X PUT \
-H "Accept: application/vnd.github+json" \
-H "Authorization: token ${{ secrets.TOKEN_KEYS }}" \
https://api.github.com/repos/$line/actions/workflows/R-CMD-check-dev.yaml/enable
done < repo_list