forked from scikit-learn/scikit-learn
-
Notifications
You must be signed in to change notification settings - Fork 1
48 lines (45 loc) · 1.38 KB
/
update_tracking_issue.yml
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
# For workflows to use this workflow include the following:
#
# update-tracker:
# uses: ./.github/workflows/update_tracking_issue.yml
# if: ${{ always() }}
# needs: [JOB_NAME]
# with:
# job_status: ${{ needs.JOB_NAME.result }}
# secrets:
# BOT_GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
# Where JOB_NAME is contains the status of the job you are interested in
name: "Update tracking issue"
on:
workflow_call:
inputs:
job_status:
required: true
type: string
secrets:
BOT_GITHUB_TOKEN:
required: true
jobs:
update_tracking_issue:
runs-on: ubuntu-latest
if: github.repository == 'scikit-learn/scikit-learn' && github.event_name == 'schedule'
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.9'
- name: Update tracking issue on GitHub
run: |
set -ex
if [[ ${{ inputs.job_status }} == "success" ]]; then
TESTS_PASSED=true
else
TESTS_PASSED=false
fi
pip install defusedxml PyGithub
python maint_tools/update_tracking_issue.py \
${{ secrets.BOT_GITHUB_TOKEN }} \
"$GITHUB_WORKFLOW" \
"$GITHUB_REPOSITORY" \
https://github.com/$GITHUB_REPOSITORY/actions/runs/$GITHUB_RUN_ID \
--tests-passed $TESTS_PASSED