Create release bug report issue when release branch gets created #16908
Workflow file for this run
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
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" |