-
-
Notifications
You must be signed in to change notification settings - Fork 207
47 lines (42 loc) · 1.82 KB
/
create-update-issues.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
name: Create Update Issues
on:
workflow_call:
secrets:
CORE_CREATE_UPDATE_ISSUES_TOKEN:
description: GitHub token with permission to create issues in both mobile and extension repositories
required: true
jobs:
create-update-issues:
environment: default-branch
runs-on: ubuntu-latest
steps:
- name: Checkout head
uses: actions/checkout@v4
- name: Fetch tags
run: git fetch --prune --unshallow --tags
- name: Create Issues
env:
GH_TOKEN: ${{ secrets.CORE_CREATE_UPDATE_ISSUES_TOKEN }}
run: |
IFS=$'\n' read -r -d '' -a tag_array < <(git tag --points-at HEAD && printf '\0')
for tag in "${tag_array[@]}"; do
if [[ "${tag}" == @metamask/* ]] ; then
# Extract package name without the leading '@'
package_name="${tag#@}"
package_name="${package_name%@*}"
# Extract version number
version="${tag##*@}"
# Check if version number ends with .0.0
if [[ $version == *.0.0 ]]; then
# Fetch responsible teams from file
teams=$(jq -r --arg key "$package_name" '.[$key]' teams.json)
labels="client-controller-update"
if [[ $teams != "null" ]]; then
labels+=",$teams"
fi
gh issue create --title "Update ${package_name} to version ${version}" --body "Please update ${package_name} to version ${version}" --repo "MetaMask/metamask-extension" --label "$labels"
gh issue create --title "Update ${package_name} to version ${version}" --body "Please update ${package_name} to version ${version}" --repo "MetaMask/metamask-mobile" --label "$labels"
fi
fi
done
shell: bash