mirror of
https://github.com/facebook/react-native.git
synced 2025-11-01 09:14:26 +00:00
2e55adf339
Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/45541 This is another round of letting react-native-bot do the job that the generic GitHub Action bot was doing. Changelog: [Internal] [Changed] - Act On label as react-native-bot Reviewed By: cipolleschi Differential Revision: D59959468 fbshipit-source-id: 8e0f7e2e90a40ed2aa265e637c8a809064e22747
61 lines
2.2 KiB
YAML
61 lines
2.2 KiB
YAML
name: On Issue Labeled
|
|
# This workflow is triggered when a label is added to an issue.
|
|
on:
|
|
issues:
|
|
types: [labeled]
|
|
|
|
permissions:
|
|
contents: write
|
|
issues: write
|
|
|
|
jobs:
|
|
# Runs automatic checks on issues labeled with "Needs: Triage",
|
|
# then invokes actOnLabel to react to any added labels
|
|
triage-issue:
|
|
runs-on: ubuntu-latest
|
|
if: "${{ github.repository == 'facebook/react-native' && contains(github.event.label.name, 'Needs: Triage :mag:') }}"
|
|
steps:
|
|
- name: Checkout code
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Verify RN version
|
|
uses: actions/github-script@v6
|
|
with:
|
|
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
|
script: |
|
|
const verifyVersion = require('./.github/workflow-scripts/verifyVersion.js')
|
|
const labelWithContext = await verifyVersion(github, context);
|
|
|
|
if(labelWithContext && labelWithContext.label) {
|
|
await github.rest.issues.addLabels({
|
|
issue_number: context.issue.number,
|
|
owner: context.repo.owner,
|
|
repo: context.repo.repo,
|
|
labels: [labelWithContext.label]
|
|
})
|
|
|
|
const actOnLabel = require('./.github/workflow-scripts/actOnLabel.js')
|
|
await actOnLabel(github, context, labelWithContext)
|
|
}
|
|
|
|
- name: Add descriptive label
|
|
uses: actions/github-script@v6
|
|
with:
|
|
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
|
script: |
|
|
const addDescriptiveLabel = require('./.github/workflow-scripts/addDescriptiveLabels.js')
|
|
await addDescriptiveLabel(github, context);
|
|
|
|
# Reacts to the label that triggered this workflow (added manually or via other workflows)
|
|
act-on-label:
|
|
runs-on: ubuntu-latest
|
|
if: github.repository == 'facebook/react-native'
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
- uses: actions/github-script@v6
|
|
with:
|
|
github-token: ${{ secrets.REACT_NATIVE_BOT_GITHUB_TOKEN }}
|
|
script: |
|
|
const actOnLabel = require('./.github/workflow-scripts/actOnLabel.js')
|
|
await actOnLabel(github, context, {label: context.payload.label.name})
|