forked from open-edge-platform/geti-instant-learn
-
Notifications
You must be signed in to change notification settings - Fork 0
75 lines (61 loc) · 2.16 KB
/
daily.yml
File metadata and controls
75 lines (61 loc) · 2.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
name: daily
on:
schedule:
- cron: "0 0 * * *" # Run every day at midnight UTC
workflow_dispatch:
permissions: {} # No permissions by default
jobs:
build-parameters:
name: Prepare build parameters
runs-on: ubuntu-latest
permissions:
contents: read
outputs:
build_version: "${{ steps.build-version.outputs.version }}"
steps:
- name: Checkout code
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
with:
fetch-depth: 0
persist-credentials: false
- name: build-version
id: build-version
uses: ./.github/actions/build-version
distrib:
name: Daily Distrib Check
needs: build-parameters
uses: ./.github/workflows/distrib.yml
permissions:
contents: read
with:
build_version: ${{ needs.build-parameters.outputs.build_version }}
create-issue-on-failure:
name: Create issue on scheduled workflow failure
runs-on: ubuntu-latest
needs: distrib
if: failure()
permissions:
issues: write # Permission to create issues
steps:
- name: Create GitHub Issue
uses: actions/github-script@ed597411d8f924073f98dfc5c65a23a2325f34cd # v8.0.0
with:
script: |
const workflowRunUrl = `${context.serverUrl}/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`;
const issueTitle = `[Scheduled Check] Distrib workflow failed - ${new Date().toISOString().split('T')[0]}`;
const issueBody = `## Bug Report
**Type:** Bug
**Description:** The scheduled distrib workflow has failed.
**Failed Workflow Run:** [View the failed run](${workflowRunUrl})
**Triggered at:** ${new Date().toISOString()}
**Workflow:** ${context.workflow}
**Run ID:** ${context.runId}
Please investigate the failure and take appropriate action.
`;
await github.rest.issues.create({
owner: context.repo.owner,
repo: context.repo.repo,
title: issueTitle,
body: issueBody,
labels: ['bug']
});