yum-mirror/slang

Making it easier to work with shaders

git clone https://git.yummers.dev/yum-mirror/slang

sricker-nvidiaUpdate the access tokens used for auto labeling CI (#6811)c1d1e37c9

master
2.0 KiB61 linesraw
1name: Add Issue Labels
2
3on:
4  issues:
5    types: [opened]
6  workflow_dispatch:
7    inputs:
8      test_username:
9        description: "GitHub username to test with"
10        required: true
11        type: string
12
13jobs:
14  add-dev-opened-label:
15    runs-on: ubuntu-latest
16    permissions:
17      issues: write
18      contents: read
19    steps:
20      - name: Check if issue creator is in Nvidia dev team
21        id: check_team
22        uses: actions/github-script@v7
23        with:
24          github-token: ${{ secrets.SLANGBOT_MEMBERS_READONLY }}
25          script: |
26            const response = await github.rest.teams.listMembersInOrg({
27              org: 'shader-slang',
28              team_slug: 'dev'
29            });
30
31            // For testing, use the provided username otherwise use the actual issue creator
32            const username = '${{ github.event.inputs.test_username || github.event.issue.user.login }}';
33
34            // Check if user is in the Nvidia dev team
35            const isTeamMember = response.data.some(member =>
36              member.login === username &&
37              member.login !== 'fairywreath'
38            );
39
40            console.log(`Checking membership for: ${username}`);
41            console.log(`Is Nvidia dev team member: ${isTeamMember}`);
42
43            core.setOutput('is_team_member', isTeamMember);
44
45      - name: Add Dev Opened Label
46        if: steps.check_team.outputs.is_team_member == 'true'
47        uses: actions/github-script@v7
48        with:
49          github-token: ${{ secrets.SLANGBOT_ISSUES_WRITE }}
50          script: |
51            // Only add label if this is a real issue and not a test run
52            if (context.eventName === 'issues') {
53              github.rest.issues.addLabels({
54                issue_number: context.issue.number,
55                owner: context.repo.owner,
56                repo: context.repo.repo,
57                labels: ['Dev Opened']
58              });
59            } else {
60              console.log('Test run - would add label to issue if this was a real issue');
61            }