-
Notifications
You must be signed in to change notification settings - Fork 2
100 lines (87 loc) · 3.09 KB
/
ManageIssueOpened.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
name: Image Magic or Manage Game Files
on:
issues:
types: [opened]
jobs:
imageMagic:
name: Image Magic
runs-on: ubuntu-latest
if: |
startsWith(github.event.issue.title, 'Transform') ||
startsWith(github.event.issue.title, 'CreateImage') ||
startsWith(github.event.issue.title, 'ImageToGif') ||
startsWith(github.event.issue.title, 'GifBackgroundRemoval')
permissions:
contents: write
issues: write
steps:
- uses: actions/checkout@v4
# Set up a Python 3.12 (64-bit) instance
- name: Setting up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
architecture: "x64"
# Use pip to install the dependencies and then run the script
- name: Start image transform
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_OWNER: ${{ github.repository_owner }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
DISALLOWED_WORDS: ${{ vars.DISALLOWED_WORDS }}
run: |
pip install -r requirements.txt
python main.py
# Create new commit with the changed files and push it to GitHub
- name: Commit and push changes
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
run: |
chmod +x ./workflowScripts/pull-then-push.sh
./workflowScripts/pull-then-push.sh
ManageGameFiles:
name: Manage Game Files
runs-on: ubuntu-latest
if: |
startsWith(github.event.issue.title, 'DeleteEntry') ||
startsWith(github.event.issue.title, 'Game') ||
startsWith(github.event.issue.title, 'Vote')
permissions:
contents: write
issues: write
steps:
- uses: actions/checkout@v4
# Set up a Python 3.12 (64-bit) instance
- name: Setting up Python
uses: actions/setup-python@v4
with:
python-version: "3.12"
architecture: "x64"
# Use pip to install the dependencies and then run the script
- name: Manage game state
env:
ISSUE_NUMBER: ${{ github.event.issue.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
REPOSITORY_OWNER: ${{ github.repository_owner }}
DISCORD_TOKEN: ${{ secrets.DISCORD_TOKEN }}
run: |
pip install -r ./PlayGame/requirements.txt
python ./PlayGame/manageGameState.py
# Create new commit with the changed files and push it to GitHub
- name: Commit and push changes
env:
ISSUE_TITLE: ${{ github.event.issue.title }}
ISSUE_AUTHOR: ${{ github.event.issue.user.login }}
run: |
chmod +x ./workflowScripts/pull-then-push.sh
./workflowScripts/pull-then-push.sh
CheckCurrentWinners:
name: Start Manage Game Files
needs: ManageGameFiles
if: startsWith(github.event.issue.title, 'Vote')
uses: ./.github/workflows/CheckCurrentWinners.yml
permissions:
contents: write
issues: write