generated from UK-Export-Finance/nestjs-template
-
Notifications
You must be signed in to change notification settings - Fork 1
53 lines (47 loc) · 1.65 KB
/
pr.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
# This YAML configuration defines a GitHub Actions workflow named "PR" designed to analyse pull requests
# for staleness and take action accordingly.
#
# Identify: Uses the actions/stale@v5 action with parameters to mark pull requests as stale if
# they have been inactive for a certain number of days and close them if they exceed another threshold.
# This workflow helps maintain the health of the pull request queue by identifying and managing stale pull requests automatically.
#
name: PR
run-name: 🔎 Pull request analysis on ${{ github.event.number }}
on:
schedule:
- cron: "00 00 * * *"
env:
environment: "qa"
timezone: ${{ vars.TIMEZONE }}
jobs:
# 1. Setup test infrastructure
setup:
name: Infrastructure setup 🔧
runs-on: ubuntu-latest
outputs:
environment: ${{ env.environment }}
timezone: ${{ env.timezone }}
steps:
- name: Environment 🧪
run: echo "Environment set to ${{ env.environment }}"
- name: Timezone 🌐
run: echo "Timezone set to ${{ env.timezone }}"
# 2. Identify stale PRs
stale:
name: Stale 📅
needs: setup
environment:
name: ${{ needs.setup.outputs.environment }}
runs-on: ubuntu-latest
permissions:
pull-requests: write
steps:
- name: Identify
uses: actions/stale@v9
with:
days-before-pr-stale: ${{ vars.STALE_PR_DAYS }}
stale-pr-message: "Pull request marked as stale due to inactivity."
stale-pr-label: "Stale"
days-before-pr-close: ${{ vars.CLOSE_PR_DAYS }}
close-pr-message: "Pull request has been closed due to inactivity."
close-pr-label: "Closed"