xref: /expo/.github/workflows/issue-opened.yml (revision 9558d768)
1name: Process a newly opened issue
2
3env:
4  TRUSTED_USERS: 'RodolfoGS awinograd hesyifei LinusU SimenB actuallymentor derekstavis wscotten wcandillon tevonsb MaRaSu devashishsethia bndkt'
5
6on:
7  issues:
8    types: [opened]
9
10jobs:
11  check-if-trusted:
12    runs-on: ubuntu-22.04
13    steps:
14      - uses: 8398a7/[email protected]
15        if: ${{ contains( env.TRUSTED_USERS, github.event.issue.user.login ) }}
16        env:
17          SLACK_WEBHOOK_URL: ${{ secrets.slack_webhook_expo_support }}
18          GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
19        with:
20          status: ${{ job.status }}
21          channel: '#support'
22          text: 'This issue should be triaged ASAP: ${{ github.event.issue.html_url }}'
23          author_name: ${{ github.event.issue.user.login }}
24          fields: repo
25      - uses: actions/github-script@v6
26        if: ${{ contains( env.TRUSTED_USERS, github.event.issue.user.login ) }}
27        with:
28          github-token: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
29          script: |
30            github.rest.issues.addLabels({
31              issue_number: context.issue.number,
32              owner: context.repo.owner,
33              repo: context.repo.repo,
34              labels: ['!']
35            })
36
37  validate:
38    runs-on: ubuntu-22.04
39    steps:
40      - name: �� Checkout
41        uses: actions/checkout@v3
42      - name: ➕ Add `bin` to GITHUB_PATH
43        run: echo "$(pwd)/bin" >> $GITHUB_PATH
44      - name: ♻️ Restore caches
45        uses: ./.github/actions/expo-caches
46        id: expo-caches
47        with:
48          yarn-tools: 'true'
49      - name: �� Validate issue complies with requirements
50        run: expotools validate-issue --issue "${{ github.event.issue.number }}"
51        env:
52          GITHUB_TOKEN: ${{ secrets.EXPO_BOT_GITHUB_TOKEN }}
53