Check precompiled dependency links #2
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Check precompiled dependency links | |
| on: | |
| schedule: | |
| - cron: "0 6 * * *" | |
| workflow_dispatch: | |
| permissions: | |
| issues: write | |
| jobs: | |
| check_links: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: erlef/setup-beam@v1 | |
| with: | |
| otp-version: "27" | |
| elixir-version: "1.18" | |
| - run: mix deps.get | |
| - id: check_links | |
| run: mix run scripts/check_links.exs | |
| - name: Open issue on failure | |
| if: failure() && steps.check_links.outcome == 'failure' | |
| uses: actions/github-script@v7 | |
| with: | |
| script: | | |
| const title = "Broken precompiled dependency links"; | |
| const open = await github.rest.issues.listForRepo({ | |
| ...context.repo, | |
| state: "open", | |
| labels: "broken-links", | |
| }); | |
| if (open.data.length === 0) { | |
| await github.rest.issues.create({ | |
| ...context.repo, | |
| title, | |
| labels: ["broken-links"], | |
| body: | |
| "The daily link check failed - some precompiled dependency links " + | |
| "are broken. See the workflow run for the list of broken URLs: " + | |
| `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`, | |
| }); | |
| } |