-
Notifications
You must be signed in to change notification settings - Fork 1
81 lines (74 loc) · 2.8 KB
/
update-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
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
name: Update Issue
on:
issue_comment:
types: [created]
# Permissions needed for reacting to IssueOps commands on issues
permissions:
issues: write
checks: read
jobs:
update-issue:
runs-on: ubuntu-latest
if:
${{ !github.event.issue.pull_request && (
contains(github.event.comment.body, '/encode_email') ||
contains(github.event.comment.body, '/decode_email') ) }}
steps:
- name: encode_email command
id: encode_email_command
uses: github/[email protected]
with:
command: "/encode_email"
reaction: "rocket"
allowed_contexts: "issue"
permissions: "read,triage,write,maintain,admin"
allowlist:
"${{ vars.MORPHOCLOUD_GITHUB_ADMINS }},${{
github.event.issue.user.login }}"
- name: decode_email command
id: decode_email_command
uses: github/[email protected]
with:
command: "/decode_email"
reaction: "rocket"
allowed_contexts: "issue"
permissions: "read,triage,write,maintain,admin"
allowlist:
"${{ vars.MORPHOCLOUD_GITHUB_ADMINS }},${{
github.event.issue.user.login }}"
- name: Set command metadata
id: command
if:
${{ steps.encode_email_command.outputs.continue == 'true' ||
steps.decode_email_command.outputs.continue == 'true' }}
run: |
if [[ "$ENCODE_EMAIL_COMMAND_CONTINUE" == "true" ]]; then
continue="$ENCODE_EMAIL_COMMAND_CONTINUE"
command_name="encode_email"
comment_id="${{ steps.encode_email_command.outputs.comment_id }}"
elif [[ "$DECODE_EMAIL_COMMAND_CONTINUE" == "true" ]]; then
continue="$DECODE_EMAIL_COMMAND_CONTINUE"
command_name="decode_email"
comment_id="${{ steps.decode_email_command.outputs.comment_id }}"
else
continue="false"
command_name=""
comment_id=""
fi
echo "continue=$continue" >> $GITHUB_OUTPUT
echo "command_name=$command_name" >> $GITHUB_OUTPUT
echo "comment_id=$comment_id" >> $GITHUB_OUTPUT
env:
ENCODE_EMAIL_COMMAND_CONTINUE:
${{ steps.encode_email_command.outputs.continue }}
DECODE_EMAIL_COMMAND_CONTINUE:
${{ steps.decode_email_command.outputs.continue }}
- uses: actions/checkout@v4
- name: Update issue description
if: ${{ steps.command.outputs.continue == 'true' }}
uses: ./.github/actions/update-issue-description
with:
issue_number: ${{ github.event.issue.number }}
command_name: ${{ steps.command.outputs.command_name }}
token: ${{ secrets.GITHUB_TOKEN }}
string_encryption_key: ${{ secrets.STRING_ENCRYPTION_KEY }}