-
Notifications
You must be signed in to change notification settings - Fork 452
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[ci] automate updates to .github/ISSUE_TEMPLATE/integration_bug.yml (#…
…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
1 parent
c223a56
commit a68b246
Showing
1 changed file
with
51 additions
and
0 deletions.
There are no files selected for viewing
51 changes: 51 additions & 0 deletions
51
.github/workflows/updatecli/updatecli.d/sync-packages-to-bug-issue-template.yml
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
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 |