From 60352a954922fa8d4a34e2eccea34d5d63077a3a Mon Sep 17 00:00:00 2001 From: Lucas Bento Date: Mon, 1 Nov 2021 11:38:50 -0700 Subject: [PATCH] Add workflow to create version labels on new releases (#32508) Summary: This PR adds the following GitHub actions: - https://github.com/lucasbento/core-workflow-create-version-label - Create version labels (such as `Version: 0.65.1`) whenever there's a new release; - https://github.com/lucasbento/core-workflow-apply-version-label - Apply a version label to opened/edited issues based on the version mentioned on the issue body. ## Changelog N/A. ## Few things to keep in mind - A label named "Version: unspecified" must be created; - The GitHub action to create labels will only run when there's a new release or if one is edited, it will then create all the other labels bases on the previous releases until it encounters one that already exists. --- Example of issue with version label: https://github.com/lucasbento/test-issue-forms/issues/4 Pull Request resolved: https://github.com/facebook/react-native/pull/32508 Reviewed By: cortinico Differential Revision: D32055682 Pulled By: lunaleaps fbshipit-source-id: 04d3e942eb1f71b3bc1d5a643b0156c35ef5f00b --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .../ISSUE_TEMPLATE/release_blocker_form.yml | 6 +++--- .../ISSUE_TEMPLATE/upgrade-regression-form.yml | 6 +++--- .../workflows/apply-version-label-issue.yml | 16 ++++++++++++++++ .../workflows/create-new-tag-version-label.yml | 18 ++++++++++++++++++ 5 files changed, 41 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/apply-version-label-issue.yml create mode 100644 .github/workflows/create-new-tag-version-label.yml diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index 6af131b9f5b..d2c508fc226 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -25,7 +25,7 @@ body: id: react-native-info attributes: label: Output of `react-native info` - description: Run `react-native info` in your terminal and copy the results here. + description: Run `react-native info` in your terminal, copy and paste the results here. validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/release_blocker_form.yml b/.github/ISSUE_TEMPLATE/release_blocker_form.yml index 82e40388dd1..b8c35d75e6d 100644 --- a/.github/ISSUE_TEMPLATE/release_blocker_form.yml +++ b/.github/ISSUE_TEMPLATE/release_blocker_form.yml @@ -23,10 +23,10 @@ body: validations: required: true - type: textarea - id: environment + id: react-native-info attributes: - label: Developer Environment - description: Please list relevant versions of system, tooling. Ex. OS, processor, Xcode, etc. + label: Output of `react-native info` + description: Run `react-native info` in your terminal, copy and paste the results here. validations: required: true - type: textarea diff --git a/.github/ISSUE_TEMPLATE/upgrade-regression-form.yml b/.github/ISSUE_TEMPLATE/upgrade-regression-form.yml index 985ec047e81..7e4fd8066c7 100644 --- a/.github/ISSUE_TEMPLATE/upgrade-regression-form.yml +++ b/.github/ISSUE_TEMPLATE/upgrade-regression-form.yml @@ -31,10 +31,10 @@ body: validations: required: true - type: textarea - id: environment + id: react-native-info attributes: - label: Developer Environment - description: Please list relevant versions of system, tooling. Ex. OS, processor, Xcode, etc. + label: Output of `react-native info` + description: Run `react-native info` in your terminal, copy and paste the results here. validations: required: true - type: textarea diff --git a/.github/workflows/apply-version-label-issue.yml b/.github/workflows/apply-version-label-issue.yml new file mode 100644 index 00000000000..c9ae9364b64 --- /dev/null +++ b/.github/workflows/apply-version-label-issue.yml @@ -0,0 +1,16 @@ +name: Apply version label to issue + +on: + issues: + types: [opened, edited] + +jobs: + add-version-label-issue: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - uses: lucasbento/core-workflow-apply-version-label@v0.0.4 + with: + github-token: ${{ secrets.GITHUB_TOKEN }} diff --git a/.github/workflows/create-new-tag-version-label.yml b/.github/workflows/create-new-tag-version-label.yml new file mode 100644 index 00000000000..00373c85717 --- /dev/null +++ b/.github/workflows/create-new-tag-version-label.yml @@ -0,0 +1,18 @@ +name: Create new tag as version label + +on: + release: + types: + - created + - edited + +jobs: + add-new-tag-version-label: + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v1 + + - uses: lucasbento/core-workflow-create-version-label@v0.0.1 + with: + github-token: ${{ secrets.GITHUB_TOKEN }}