-
Notifications
You must be signed in to change notification settings - Fork 0
57 lines (54 loc) · 3.26 KB
/
issue-sync.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
name: Sync GitHub issues with Discord
on:
issues:
types: [opened, edited, closed, deleted, locked, unlocked, assigned, unassigned]
concurrency:
group: ${{ github.workflow }}-${{ github.event.issue.number }}
cancel-in-progress: true
jobs:
issues-sync:
runs-on: ubuntu-24.04
environment: "Issues Sync"
name: Sync issue
steps:
- name: Convert project number to ID
id: convert_project_number_to_id
uses: Beastslash/[email protected]
with:
github-project-number: ${{ vars.ISSUES_SYNC_GITHUB_PROJECT_NUMBER }}
github-app-id: ${{ vars.ISSUES_SYNC_GITHUB_APP_ID }}
github-app-private-key: ${{ secrets.ISSUES_SYNC_GITHUB_APP_PRIVATE_KEY }}
github-app-installation-id: ${{ vars.ISSUES_SYNC_GITHUB_APP_INSTALLATION_ID }}
- name: Convert issue number to project item ID
id: convert_issue_number_to_project_item_id
if: steps.convert_project_number_to_id.outputs.GITHUB_PROJECT_ID != 0
uses: Beastslash/[email protected]
with:
github-project-id: ${{ steps.convert_project_number_to_id.outputs.GITHUB_PROJECT_ID }}
github-app-id: ${{ vars.ISSUES_SYNC_GITHUB_APP_ID }}
github-app-private-key: ${{ secrets.ISSUES_SYNC_GITHUB_APP_PRIVATE_KEY }}
github-app-installation-id: ${{ vars.ISSUES_SYNC_GITHUB_APP_INSTALLATION_ID }}
- name: Convert project field name to ID
id: convert_project_field_name_to_ID
uses: Beastslash/[email protected]
if: steps.convert_project_number_to_id.outputs.GITHUB_PROJECT_ID != 0 && steps.convert_issue_number_to_project_item_id.outputs.GITHUB_PROJECT_ITEM_ID != 0
with:
github-project-id: ${{ steps.convert_project_number_to_id.outputs.GITHUB_PROJECT_ID }}
github-project-field-name: ${{ vars.ISSUES_SYNC_GITHUB_PROJECT_FIELD_NAME }}
github-app-id: ${{ vars.ISSUES_SYNC_GITHUB_APP_ID }}
github-app-private-key: ${{ secrets.ISSUES_SYNC_GITHUB_APP_PRIVATE_KEY }}
github-app-installation-id: ${{ vars.ISSUES_SYNC_GITHUB_APP_INSTALLATION_ID }}
- name: Sync issue with Discord
id: sync_issue_with_discord
uses: DaDragonDen/issues-sync@main
if: steps.convert_project_number_to_id.outputs.GITHUB_PROJECT_ID != 0 && steps.convert_issue_number_to_project_item_id.outputs.GITHUB_PROJECT_ITEM_ID != 0 && steps.convert_project_field_name_to_ID.outputs.GITHUB_PROJECT_FIELD_ID != 0
with:
discord-token: ${{ secrets.ISSUES_SYNC_DISCORD_TOKEN }}
discord-channel-id: ${{ vars.ISSUES_SYNC_DISCORD_CHANNEL_ID }}
discord-user-map: ${{ vars.ISSUES_SYNC_DISCORD_USER_MAP }}
github-project-id: ${{ steps.convert_project_number_to_id.outputs.GITHUB_PROJECT_ID }}
github-project-item-id: ${{ steps.convert_issue_number_to_project_item_id.outputs.GITHUB_PROJECT_ITEM_ID }}
github-project-field-id: ${{ steps.convert_project_field_name_to_ID.outputs.GITHUB_PROJECT_FIELD_ID }}
github-app-id: ${{ vars.ISSUES_SYNC_GITHUB_APP_ID }}
github-app-private-key: ${{ secrets.ISSUES_SYNC_GITHUB_APP_PRIVATE_KEY }}
github-app-installation-id: ${{ vars.ISSUES_SYNC_GITHUB_APP_INSTALLATION_ID }}