-
Notifications
You must be signed in to change notification settings - Fork 31
66 lines (60 loc) · 2.31 KB
/
refreshcerts.yaml
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
name: Refreshcerts
on:
workflow_dispatch:
schedule:
- cron: '42 12 * * *' # At 1242 each day
permissions: # added using https://github.com/step-security/secure-workflows
contents: read
jobs:
checkcert:
runs-on: ubuntu-latest
outputs:
cert: ${{ steps.checkcert.outputs.cert }}
steps:
- name: checkout repo content
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- id: checkcert
name: Check for new cert
run: |
cd tests/at_functional_test/test/testData
CERTURL='https://raw.githubusercontent.com/atsign-foundation/at_server/trunk/tools/build_virtual_environment/ve_base/contents/atsign/secondary/base/certs/cert.pem'
wget -O cert.pem ${CERTURL}
if [ -z "$(git status --porcelain)" ]; then
echo 'No new cert'
echo "cert=NOTNEW" >> $GITHUB_OUTPUT
else
echo "cert=NEW" >> $GITHUB_OUTPUT
fi
update_cert_in_repo:
needs: [checkcert]
if: ${{ needs.checkcert.outputs.cert == 'NEW' }}
runs-on: ubuntu-latest
steps:
- name: checkout_to_update_version
uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac # v4.0.0
- name: Update stable version
id: getcert
run: |
cd tests/at_functional_test/test/testData
CERTURL='https://raw.githubusercontent.com/atsign-foundation/at_server/trunk/tools/build_virtual_environment/ve_base/contents/atsign/secondary/base/certs/cert.pem'
wget -O cert.pem ${CERTURL}
- name: Create Pull Request
id: cpr
uses: peter-evans/create-pull-request@153407881ec5c347639a548ade7d8ad1d6740e38 # v5.0.2
with:
token: ${{ secrets.MY_GITHUB_TOKEN }}
commit-message: 'chore: Update cert in testdata'
committer: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com>
author: library-action[bot] <41898282+github-actions[bot]@users.noreply.github.com>
signoff: false
add-paths: .
branch: bot-new-cert
delete-branch: true
title: 'chore: Update cert in testdata'
body: |
New cert copied from at_server
labels: |
operations
assignees: cpswan
reviewers: gkc
draft: false