-
Notifications
You must be signed in to change notification settings - Fork 37
67 lines (57 loc) · 2.08 KB
/
Copy pathissue-comment.yml
File metadata and controls
67 lines (57 loc) · 2.08 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
# React to `/image-refresh <image>` comments on issues/PRs.
name: issue-comment
on:
issue_comment:
types: [created]
jobs:
image-refresh:
if: startsWith(github.event.comment.body, '/image-refresh ')
runs-on: ubuntu-latest
environment: image-build
permissions:
issues: write
pull-requests: write
steps:
- name: Clone repository
uses: actions/checkout@v5
- name: Install dependencies
run: pip install -r requirements.txt
- name: Set up secrets/config
run: |
mkdir -p ~/.config/cockpit-dev
cat > ~/.config/cockpit-dev/job-runner.toml << EOF
[secrets.inline]
github-token = '${{ secrets.COCKPITUOUS_TOKEN }}'
s3-keys."amazonaws.com" = '${{ secrets.AWS_KEY_LOGS }}'
[logs]
driver = 's3'
[logs.s3]
url = 'https://cockpit-ci-logs.s3.us-east-1.amazonaws.com/'
key = '${{ secrets.AWS_KEY_LOGS }}'
acl = '' # BucketOwnerEnforced - bucket policy handles public access, ACLs disabled
[forge.github]
post = true
token = '${{ secrets.COCKPITUOUS_TOKEN }}'
[container]
run-args = [
'--device=/dev/kvm',
'--env=GIT_COMMITTER_NAME=Cockpituous',
'--env=GIT_COMMITTER_EMAIL=cockpituous@cockpit-project.org',
'--env=GIT_AUTHOR_NAME=Cockpituous',
'--env=GIT_AUTHOR_EMAIL=cockpituous@cockpit-project.org',
]
[container.secrets]
github-token = [
'--volume=%{github-token}:/run/secrets/github-token:ro,z,U',
'--env=COCKPIT_GITHUB_TOKEN_FILE=/run/secrets/github-token',
]
image-upload = [
'--volume=%{s3-keys}:/run/secrets/s3-keys:ro,z,U',
'--env=COCKPIT_S3_KEY_DIR=/run/secrets/s3-keys',
]
EOF
- name: Handle comment and submit to Testing Farm
env:
TESTING_FARM_API_TOKEN: ${{ secrets.TESTING_FARM_RH_TOKEN }}
run: |
./issue-comment event "$GITHUB_EVENT_PATH"