Skip to content

Commit

Permalink
[ci] automate updates to .github/ISSUE_TEMPLATE/integration_bug.yml (#…
Browse files Browse the repository at this point in the history
…10924)

Keep the list of packages in the bug issue template in sync with the packages contained in
the repo by utilizing updatecli.

Closes: #10565

---------

Co-authored-by: Mario Rodriguez Molins <[email protected]>
  • Loading branch information
andrewkroh and mrodm authored Aug 29, 2024
1 parent c223a56 commit a68b246
Showing 1 changed file with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
---
name: Update package list in Github bug issue template
pipelineid: sync-packages-to-bug-issue-template

scms:
default:
kind: github
spec:
owner: '{{ .scm.owner }}'
repository: '{{ .scm.repository }}'
user: '{{ requiredEnv "GITHUB_ACTOR" }}'
username: '{{ requiredEnv "GITHUB_ACTOR" }}'
token: '{{ requiredEnv "GITHUB_TOKEN" }}'
commitusingapi: true
branch: main

targets:
integration_bug_yml:
name: update pkgs in .github/ISSUE_TEMPLATE/integration_bug.yml
kind: shell
scmid: default
spec:
environments:
- name: PATH
- name: HOME
# This script collects titles and package names (as determined by their
# directory name) from source. Then updates the issue template. It uses
# 'git diff' to satisfy the conditions needed by updatecli to determine
# if any changes occurred.
command: |
#!/usr/bin/env bash
set -eu
pkgs=$(for i in $(LC_ALL=C ls packages); do
title=$(yq .title packages/$i/manifest.yml)
pkg=$i
echo "- $title [$pkg]"
done | yq -o json .)
yq eval ".body[1].attributes.options = $pkgs" -i '.github/ISSUE_TEMPLATE/integration_bug.yml'
git diff --name-only HEAD
actions:
openPullRequest:
title: '[automation] Update packages in .github/ISSUE_TEMPLATE/integration_bug.yml'
kind: github/pullrequest
scmid: default
spec:
labels:
- automation

0 comments on commit a68b246

Please sign in to comment.