forked from tarekwasfy01/Semantic-Programming-Language
-
Notifications
You must be signed in to change notification settings - Fork 0
73 lines (66 loc) · 2.42 KB
/
Copy pathimport-package-issue.yml
File metadata and controls
73 lines (66 loc) · 2.42 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
68
69
70
71
72
73
name: Import package request bot
on:
issues:
types: [opened]
permissions:
contents: write
issues: write
actions: read
jobs:
parse:
if: startsWith(github.event.issue.title, '[Import]:')
runs-on: ubuntu-latest
outputs:
language: ${{ steps.parse.outputs.language }}
package: ${{ steps.parse.outputs.package }}
module_name: ${{ steps.parse.outputs.module_name }}
release_version: ${{ steps.parse.outputs.release_version }}
steps:
- name: Checkout main
uses: actions/checkout@v4
with:
ref: main
- name: Parse import request
id: parse
env:
ISSUE_BODY: ${{ github.event.issue.body }}
run: python scripts/parse_import_issue.py
- name: Bot acknowledges request
env:
GH_TOKEN: ${{ github.token }}
run: |
gh issue comment "${{ github.event.issue.number }}" \
--repo "${{ github.repository }}" \
--body "🌳 Semantic bot accepted this package import request. The transpilation workflow is starting now."
import:
needs: parse
uses: ./.github/workflows/import-foreign-module.yml
with:
language: ${{ needs.parse.outputs.language }}
package: ${{ needs.parse.outputs.package }}
module_name: ${{ needs.parse.outputs.module_name }}
release_version: ${{ needs.parse.outputs.release_version }}
secrets: inherit
finish:
needs: [parse, import]
if: always() && needs.parse.result == 'success'
runs-on: ubuntu-latest
permissions:
issues: write
steps:
- name: Report result
env:
GH_TOKEN: ${{ github.token }}
run: |
if [ "${{ needs.import.result }}" = "success" ]; then
gh issue comment "${{ github.event.issue.number }}" \
--repo "${{ github.repository }}" \
--body "✅ Semantic bot finished the import. The generated module was published and the Module Store registry was updated."
gh issue close "${{ github.event.issue.number }}" \
--repo "${{ github.repository }}" \
--reason completed
else
gh issue comment "${{ github.event.issue.number }}" \
--repo "${{ github.repository }}" \
--body "❌ Semantic bot could not finish this import. Open the Actions run for the exact failed step. This issue stays open so the request can be retried."
fi