-
-
Notifications
You must be signed in to change notification settings - Fork 1.1k
35 lines (32 loc) · 2.01 KB
/
create-bug-report.yml
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
name: Create release bug report issue when release branch gets created
on: create
jobs:
create-bug-report:
runs-on: ubuntu-latest
steps:
- name: Extract version from branch name if release branch
id: extract_version
run: |
if [[ "$GITHUB_REF" =~ ^refs/heads/release/[0-9]+\.[0-9]+\.[0-9]+$ ]]; then
version="${GITHUB_REF#refs/heads/release/}"
echo "New release branch($version), continue next steps"
echo "version=$version" >> "$GITHUB_ENV"
else
echo "Not a release branch, skip next steps"
fi
- name: Create bug report issue on planning repo
if: env.version
run: |
payload=$(cat <<EOF
{
"title": "v${{ env.version }} Bug Report",
"body": "**What is this bug report issue for?**\n\n1. This issue is used to track release dates on this [Github Project board](https://github.com/orgs/MetaMask/projects/86/views/3), which content then gets pulled into our metrics system.\n\n2. This issue is also used by our Zapier automations, to determine if automated notifications shall be sent on Slack for release \`${{ env.version }}\`. Notifications will only be sent as long as this issue is open.\n\n**Who created and/or closed this issue?**\n\n- This issue was automatically created by a GitHub action upon the creation of the release branch \`release/${{ env.version }}\`, indicating the release was cut.\n\n- This issue gets automatically closed by another GitHub action, once the \`release/${{ env.version }}\` branch merges into \`main\`, indicating the release is prepared for store submission.",
"labels": ["type-bug", "team-mobile-platform", "regression-RC-${{ env.version }}"]
}
EOF
)
curl -X POST \
-H "Authorization: token ${{ secrets.BUG_REPORT_TOKEN }}" \
-H "Accept: application/vnd.github.v3+json" \
https://api.github.com/repos/MetaMask/mobile-planning/issues \
-d "$payload"