2929# Workflow jobs:
3030jobs :
3131
32- # Add a new job for adding the initial reaction
32+ # Define a job for adding an initial reaction:
3333 add_initial_reaction :
3434
35+ # Define a display name:
36+ name : ' Add initial reaction'
37+
3538 # Define the type of virtual host machine:
3639 runs-on : ubuntu-latest
3740
4043
4144 # Define the job's steps:
4245 steps :
43- # Add initial reaction to the comment
46+ # Add "bot: In progress" label to the issue / PR:
47+ - name : ' Add in-progress label'
48+ # Pin action to full length commit SHA
49+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
50+ with :
51+ github-token : ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
52+ script : |
53+ github.rest.issues.addLabels({
54+ owner: context.repo.owner,
55+ repo: context.repo.repo,
56+ issue_number: context.issue.number,
57+ labels: ['bot: In Progress']
58+ })
59+
60+ # Add initial reaction to comment with slash command:
4461 - name : ' Add initial reaction'
4562 run : |
4663 COMMENT="${{ github.event.comment.body }}"
6784 # Define a job for checking for required files:
6885 check_files :
6986
87+ # Define a display name:
88+ name : ' Check for required files'
89+
90+ # Ensure initial reaction job has completed before running this job:
91+ needs : [ add_initial_reaction ]
92+
7093 # Define the conditions under which the job should run:
7194 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib check-files')
7295
81104 # Define a job for updating copyright header years:
82105 update_copyright_years :
83106
107+ # Define a display name:
108+ name : ' Update copyright header years'
109+
84110 # Define the conditions under which the job should run:
85111 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib update-copyright-years')
86112
@@ -97,6 +123,12 @@ jobs:
97123 # Define a job for auto-fixing lint errors:
98124 fix_lint_errors :
99125
126+ # Define a display name:
127+ name : ' Auto-fix lint errors'
128+
129+ # Ensure initial reaction job has completed before running this job:
130+ needs : [ add_initial_reaction ]
131+
100132 # Define the conditions under which the job should run:
101133 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib lint-autofix')
102134
@@ -113,6 +145,12 @@ jobs:
113145 # Define a job for merging develop branch:
114146 merge_develop :
115147
148+ # Define a display name:
149+ name : ' Merge changes from develop branch into this PR'
150+
151+ # Ensure initial reaction job has completed before running this job:
152+ needs : [ add_initial_reaction ]
153+
116154 # Define the conditions under which the job should run:
117155 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib merge')
118156
@@ -129,6 +167,12 @@ jobs:
129167 # Define a job for rebasing on develop branch:
130168 rebase_develop :
131169
170+ # Define a display name:
171+ name : ' Rebase this PR on top of develop branch'
172+
173+ # Ensure initial reaction job has completed before running this job:
174+ needs : [ add_initial_reaction ]
175+
132176 # Define the conditions under which the job should run:
133177 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib rebase')
134178
@@ -146,11 +190,14 @@ jobs:
146190 help :
147191
148192 # Define a display name:
149- name : ' Help '
193+ name : ' Print a list of available slash commands '
150194
151195 # Define the type of virtual host machine:
152196 runs-on : ubuntu-latest
153197
198+ # Ensure initial reaction job has completed before running this job:
199+ needs : [ add_initial_reaction ]
200+
154201 # Define the conditions under which the job should run:
155202 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib help')
156203
@@ -176,3 +223,42 @@ jobs:
176223
177224 # GitHub token:
178225 token : ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
226+
227+ # Define a job for removing the in-progress label:
228+ remove_progress_label :
229+
230+ # Define a display name:
231+ name : ' Remove in-progress label'
232+
233+ # Define the type of virtual host machine:
234+ runs-on : ubuntu-latest
235+
236+ # Ensure all previous jobs have completed before running this job:
237+ needs : [ add_initial_reaction, check_files, update_copyright_years, fix_lint_errors, merge_develop, rebase_develop, help ]
238+
239+ # Define the conditions under which the job should run:
240+ if : |
241+ always() &&
242+ github.event.issue.pull_request &&
243+ startsWith(github.event.comment.body, '/stdlib')
244+
245+ # Define the job's steps:
246+ steps :
247+ - name : Remove in-progress label
248+ # Run the step regardless of the outcome of previous steps:
249+ if : always()
250+ # Pin action to full length commit SHA
251+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
252+ with :
253+ github-token : ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
254+ script : |
255+ try {
256+ await github.rest.issues.removeLabel({
257+ owner: context.repo.owner,
258+ repo: context.repo.repo,
259+ issue_number: context.issue.number,
260+ name: 'bot: In Progress'
261+ })
262+ } catch (error) {
263+ console.log( 'Error removing label:', error );
264+ }
0 commit comments