-
Notifications
You must be signed in to change notification settings - Fork 1
99 lines (75 loc) · 2.63 KB
/
manual_update.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
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
# This is a basic workflow that is manually triggered
name: Manual Update
# Controls when the action will run. Workflow runs when manually triggered using the UI
# or API.
on:
workflow_dispatch:
# Inputs the workflow accepts.
inputs:
name:
description: 'Run'
default: 'Now'
required: true
jobs:
build:
runs-on: ubuntu-latest
outputs:
output1: ${{ steps.runpy.outputs.test }}
steps:
- name: checkout repo content
uses: actions/checkout@v3 # checkout the repository content to github runner
with:
token: ${{ secrets.GITHUB_TOKEN }}
fetch-depth: 0
- uses: fregante/setup-git-user@v1
- name: setup python
uses: actions/setup-python@v4
with:
python-version: '3.10'
- name: install python packages
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: execute py script
id: runpy
env:
EMAIL_ADDRESS: ${{ secrets.EMAIL_ADDRESS }}
EMAIL_PASSWORD: ${{ secrets.EMAIL_PASSWORD }}
EMAIL_RECIPIENT: ${{ secrets.EMAIL_RECIPIENT }}
run: |
output=$(python exfor_backups.py)
echo ::set-output name=NP::$output
- name: create release using REST API
shell: bash
run: |
for not_processed in ${{ steps.runpy.outputs.NP }}; do
echo $not_processed
tagname="Backup-"$not_processed
echo $tagname
sem_release=$(bash ${GITHUB_WORKSPACE}/semantic_release_name.sh $not_processed)
echo $sem_release
curl -X POST https://api.github.com/repos/${{ github.repository }}/releases \
--header "Accept: application/vnd.github+json" \
--header 'authorization: Bearer ${{ secrets.GITHUB_TOKEN }}' \
--data '{
"tag_name": "'$tagname'",
"name": "'$sem_release'",
"draft": false,
"prerelease": false,
"generate_release_notes": false
}'\
--fail
done
- name: run entry update list file script and commit file
run: |
if [[ -n "${{ steps.runpy.outputs.NP }}" ]]
then
bash ${GITHUB_WORKSPACE}/get_update_date.sh > entry_updatedate.dat
git config user.name github-actions
git config user.email [email protected]
git add entry_updatedate.dat
git commit -m "update entry_updatedate.dat"
git push origin main
else
echo "no update"
fi