[IRBuilder] Refactor FMF interface (#121657)
[llvm-project.git] / .github / workflows / release-asset-audit.yml
blob018c5d542f32eb158d76746cd9397ebe134f228d
1 name: Release Asset Audit
3 on:
4   workflow_dispatch:
5   release:
6   schedule:
7     # * is a special character in YAML so you have to quote this string
8     # Run once an hour
9     - cron:  '5 * * * *'
11   pull_request:
12     paths:
13       - ".github/workflows/release-asset-audit.py"
14       - ".github/workflows/release-asset-audit.yml"
16 permissions:
17   contents: read # Default everything to read-only
19 jobs:
20   audit:
21     name: "Release Asset Audit"
22     runs-on: ubuntu-22.04
23     if: github.repository == 'llvm/llvm-project'
24     steps:
25       - uses: actions/checkout@a5ac7e51b41094c92402da3b24376905380afc29 #v4.1.6
26       - name: "Run Audit Script"
27         env:
28           GITHUB_TOKEN: ${{ github.token }}
29         run: |
30           pip install --require-hashes -r ./llvm/utils/git/requirements.txt
31           python3 ./.github/workflows/release-asset-audit.py $GITHUB_TOKEN
32       - name: "File Issue"
33         if: >-
34           github.event_name != 'pull_request' &&
35           failure()
36         uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea #v7.0.1
37         with:
38           github-token: ${{ secrets.ISSUE_SUBSCRIBER_TOKEN }}
39           script: |
40             var fs = require('fs');
41             var body = ''
42             if (fs.existsSync('./comment')) {
43               body = fs.readFileSync('./comment') + "\n\n";
44             }
45             body = body + `\n\nhttps://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`
47             const issue = await github.rest.issues.create({
48                owner: context.repo.owner,
49                repo: context.repo.repo,
50                title: "Release Asset Audit Failed",
51                labels: ['infrastructure'],
52                body: body
53             });
54             console.log(issue);