cd·livecheck #289
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: cd·livecheck | |
| run-name: cd·livecheck | |
| on: | |
| schedule: | |
| - cron: '*/5 * * * *' # every 5 minutes | |
| workflow_dispatch: | |
| concurrency: | |
| group: livecheck | |
| cancel-in-progress: false | |
| jobs: | |
| livecheck: | |
| runs-on: | |
| ubuntu-latest | |
| outputs: | |
| pkgspec: ${{ steps.livecheck.outputs.pkgspec }} | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 0 # we need full history to get commit-ordering | |
| - uses: denoland/setup-deno@v2 | |
| - name: deno cache | |
| run: deno cache ./bin/pkg-livecheck | |
| - name: livecheck | |
| run: deno run -A ./bin/pkg-livecheck | |
| id: livecheck | |
| env: | |
| GITHUB_TOKEN: ${{ github.token }} | |
| # - if: ${{ steps.livecheck.outputs.cancel == '1' }} | |
| # uses: andymckay/[email protected] | |
| bottle: | |
| needs: | |
| livecheck | |
| uses: | |
| ./.github/workflows/cd.bottle.yml | |
| with: | |
| pkgs: ${{ needs.livecheck.outputs.pkgspec }} | |
| secrets: | |
| inherit | |
| complain: | |
| permissions: | |
| issues: write | |
| needs: | |
| [bottle, livecheck] | |
| if: ${{ needs.livecheck.outputs.pkgspec && failure() }} | |
| runs-on: | |
| ubuntu-latest | |
| steps: | |
| - uses: actions/github-script@v7 | |
| with: | |
| github-token: ${{ github.token }} | |
| script: | | |
| const issue_number = 10; | |
| const bullet_point = "- Job `${{ github.job }}` failed in run [#${{ github.run_number }}](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})"; | |
| const { data: issue } = await github.rest.issues.get({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number | |
| }); | |
| const updated_body = `${issue.body}\n${bullet_point}`; | |
| await github.rest.issues.update({ | |
| owner: context.repo.owner, | |
| repo: context.repo.repo, | |
| issue_number, | |
| body: updated_body | |
| }); |