|
29 | 29 | # Workflow jobs:
|
30 | 30 | jobs:
|
31 | 31 |
|
32 |
| - # Add a new job for adding the initial reaction |
| 32 | + # Define a job for adding an initial reaction: |
33 | 33 | add_initial_reaction:
|
34 | 34 |
|
35 | 35 | # Define the type of virtual host machine:
|
|
40 | 40 |
|
41 | 41 | # Define the job's steps:
|
42 | 42 | steps:
|
43 |
| - # Add initial reaction to the comment |
| 43 | + # Add "bot: In progress" label to the issue / PR: |
| 44 | + - name: 'Add in-progress label' |
| 45 | + # Pin action to full length commit SHA |
| 46 | + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 |
| 47 | + with: |
| 48 | + github-token: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }} |
| 49 | + script: | |
| 50 | + github.rest.issues.addLabels({ |
| 51 | + owner: context.repo.owner, |
| 52 | + repo: context.repo.repo, |
| 53 | + issue_number: context.issue.number, |
| 54 | + labels: ['bot: In Progress'] |
| 55 | + }) |
| 56 | +
|
| 57 | + # Add initial reaction to comment with slash command: |
44 | 58 | - name: 'Add initial reaction'
|
45 | 59 | run: |
|
46 | 60 | COMMENT="${{ github.event.comment.body }}"
|
@@ -176,3 +190,36 @@ jobs:
|
176 | 190 |
|
177 | 191 | # GitHub token:
|
178 | 192 | token: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }}
|
| 193 | + |
| 194 | + # Define a job for removing the in-progress label: |
| 195 | + remove_progress_label: |
| 196 | + |
| 197 | + # Define the type of virtual host machine: |
| 198 | + runs-on: ubuntu-latest |
| 199 | + |
| 200 | + # Ensure all previous jobs have completed before running this job: |
| 201 | + needs: [ add_initial_reaction, check_files, update_copyright_years, fix_lint_errors, merge_develop, rebase_develop, help ] |
| 202 | + |
| 203 | + # Define the conditions under which the job should run: |
| 204 | + if: github.event.issue.pull_request && startsWith( github.event.comment.body, '/stdlib' ) |
| 205 | + |
| 206 | + # Define the job's steps: |
| 207 | + steps: |
| 208 | + - name: Remove in-progress label |
| 209 | + # Run the step regardless of the outcome of previous steps: |
| 210 | + if: always() |
| 211 | + # Pin action to full length commit SHA |
| 212 | + uses: actions/github-script@60a0d83039c74a4aee543508d2ffcb1c3799cdea # v7.0.1 |
| 213 | + with: |
| 214 | + github-token: ${{ secrets.STDLIB_BOT_GITHUB_TOKEN }} |
| 215 | + script: | |
| 216 | + try { |
| 217 | + await github.rest.issues.removeLabel({ |
| 218 | + owner: context.repo.owner, |
| 219 | + repo: context.repo.repo, |
| 220 | + issue_number: context.issue.number, |
| 221 | + name: 'bot: In Progress' |
| 222 | + }) |
| 223 | + } catch (error) { |
| 224 | + console.log( 'Error removing label:', error ); |
| 225 | + } |
0 commit comments