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+
7090 # Define the conditions under which the job should run:
7191 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib check-files')
7292
81101 # Define a job for updating copyright header years:
82102 update_copyright_years :
83103
104+ # Define a display name:
105+ name : ' Update copyright header years'
106+
84107 # Define the conditions under which the job should run:
85108 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib update-copyright-years')
86109
97120 # Define a job for auto-fixing lint errors:
98121 fix_lint_errors :
99122
123+ # Define a display name:
124+ name : ' Auto-fix lint errors'
125+
100126 # Define the conditions under which the job should run:
101127 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib lint-autofix')
102128
@@ -113,6 +139,9 @@ jobs:
113139 # Define a job for merging develop branch:
114140 merge_develop :
115141
142+ # Define a display name:
143+ name : ' Merge changes from develop branch into this PR'
144+
116145 # Define the conditions under which the job should run:
117146 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib merge')
118147
@@ -129,6 +158,9 @@ jobs:
129158 # Define a job for rebasing on develop branch:
130159 rebase_develop :
131160
161+ # Define a display name:
162+ name : ' Rebase this PR on top of develop branch'
163+
132164 # Define the conditions under which the job should run:
133165 if : github.event.issue.pull_request && startsWith(github.event.comment.body, '/stdlib rebase')
134166
@@ -146,7 +178,7 @@ jobs:
146178 help :
147179
148180 # Define a display name:
149- name : ' Help '
181+ name : ' Print a list of available slash commands '
150182
151183 # Define the type of virtual host machine:
152184 runs-on : ubuntu-latest
@@ -176,3 +208,42 @@ jobs:
176208
177209 # GitHub token:
178210 token : ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
211+
212+ # Define a job for removing the in-progress label:
213+ remove_progress_label :
214+
215+ # Define a display name:
216+ name : ' Remove in-progress label'
217+
218+ # Define the type of virtual host machine:
219+ runs-on : ubuntu-latest
220+
221+ # Ensure all previous jobs have completed before running this job:
222+ needs : [ add_initial_reaction, check_files, update_copyright_years, fix_lint_errors, merge_develop, rebase_develop, help ]
223+
224+ # Define the conditions under which the job should run:
225+ if : |
226+ always() &&
227+ github.event.issue.pull_request &&
228+ startsWith(github.event.comment.body, '/stdlib')
229+
230+ # Define the job's steps:
231+ steps :
232+ - name : Remove in-progress label
233+ # Run the step regardless of the outcome of previous steps:
234+ if : always()
235+ # Pin action to full length commit SHA
236+ uses : actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1
237+ with :
238+ github-token : ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
239+ script : |
240+ try {
241+ await github.rest.issues.removeLabel({
242+ owner: context.repo.owner,
243+ repo: context.repo.repo,
244+ issue_number: context.issue.number,
245+ name: 'bot: In Progress'
246+ })
247+ } catch (error) {
248+ console.log( 'Error removing label:', error );
249+ }
0 commit comments