Skip to content

[ig/wai] WAI IG recharter #38

[ig/wai] WAI IG recharter

[ig/wai] WAI IG recharter #38

name: Create review request issues for charters
on:
issues:
types: [labeled]
# Using
# https://docs.github.com/en/actions/writing-workflows/choosing-what-your-workflow-does/running-variations-of-jobs-in-a-workflow#example-using-an-output-to-define-two-matrices
jobs:
retrieve-horizontal-repos: # define the matrix of horizontal repo names
runs-on: ubuntu-latest
outputs:
repos: ${{ steps.extract.outputs.repos }}
steps:
# Abort on http get failure
# jq comes pre-installed in Github runners: https://jqlang.org/
# -c to disable JSON pretty printing
# filter out null values and make values unique
- name: Retrieve common-labels.json
id: extract
run: |
curl --fail -o labels.json "https://w3c.github.io/common-labels.json"
REPOS=`jq -c -r '[.[]."repo-request"] | map(select(.!=null)) | unique' labels.json`
echo "repos=$REPOS" >> "$GITHUB_OUTPUT"
create-issue:
if: github.event.label.name == 'Horizontal review requested'
runs-on: ubuntu-latest
permissions:
issues: write
needs: retrieve-horizontal-repos
strategy:
matrix:
repo: ${{ fromJSON(needs.retrieve-horizontal-repos.outputs.repos) }}
steps:
- name: create issue in ${{ matrix.repo }}
run: |
echo "This issue was created because the 'horizontal review requested' label was added to ${{ github.event.issue.html_url }}" >> body.txt
echo "\nThis review is requested prior to the [Advisory Committee Review](https://www.w3.org/guide/process/charter.html#ac-review)." >> body.txt
echo "\n${{ github.event.issue.body }}" >> body.txt
gh issue create \
--repo "${{ matrix.repo }}" \
--title "${{ github.event.issue.title }}" \
--body-file body.txt
--label "charter"
env:
GITHUB_TOKEN: ${{ secrets.W3CBOT_TOKEN }}