-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathaction.yml
76 lines (76 loc) · 2.52 KB
/
action.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
name: 'Monitor artifact publication'
description: 'Monitor artifact publication to Maven Central'
inputs:
github-token:
description: 'GitHub token'
required: true
action:
description: 'Name of the action (if named)'
required: false
group-id:
description: 'Group id of the artifact'
required: true
artifact-id:
description: 'Artifact id of the artifact'
required: true
version:
description: 'Version of the artifact'
required: true
issue-number:
description: 'Issue number to post to'
required: false
message-if-published:
description: 'Message to post if artifact is published'
required: false
message-if-not-published:
description: 'Message to post if artifact is not published'
required: false
initial-delay:
description: 'Initial delay in minutes before testing for the first time'
required: true
poll-delay:
description: 'Poll delay in minutes'
required: true
poll-iterations:
description: 'Number of polling iterations'
required: true
post-delay:
description: 'Delay in minutes to wait after this particular artifact is published'
required: true
outputs:
published:
value: ${{ steps.action.outputs.published }}
runs:
using: "composite"
steps:
- name: Inject quarkus-github-action repository credentials
shell: bash
run: |
if [ -f ~/.m2/settings.xml ]; then
if ! grep -q '<id>quarkus-github-action</id>' ~/.m2/settings.xml; then
sed -i.bak 's@</servers>@<server><id>quarkus-github-action</id><username>${env.GITHUB_ACTOR}</username><password>${env.GITHUB_TOKEN}</password></server></servers>@' ~/.m2/settings.xml
fi
else
mkdir -p ~/.m2/
cat <<\EOF > ~/.m2/settings.xml
<?xml version="1.0"?>
<settings>
<servers>
<server>
<id>quarkus-github-action</id>
<username>${env.GITHUB_ACTOR}</username>
<password>${env.GITHUB_TOKEN}</password>
</server>
</servers>
</settings>
EOF
fi
- name: Set up JBang
uses: jbangdev/setup-jbang@main
- name: Run the action
id: action
run: jbang --java 21 --fresh --repos 'quarkus-github-action=https://maven.pkg.github.com/quarkusio/monitor-artifact-publication-action/' --repos 'mavencentral' io.quarkus.bot:monitor-artifact-publication-action:999-SNAPSHOT
shell: bash
env:
JSON_INPUTS: ${{ toJSON(inputs) }}
GITHUB_TOKEN: ${{ inputs.github-token }}