-
Notifications
You must be signed in to change notification settings - Fork 11
50 lines (42 loc) · 1.31 KB
/
mip-number-assignment.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
name: Assign MIP number
on:
pull_request:
types:
- closed
branches:
- main
jobs:
assign_mip_number:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: main
fetch-depth: 0
token: ${{ secrets.MIP_BOT_TOKEN }}
- name: Fetch latest changes
run: |
git fetch --no-tags --prune --depth=1 origin main
git checkout main
git reset --hard origin/main
- name: Set authentication token
run: git remote set-url origin https://x-access-token:${{ secrets.MIP_BOT_TOKEN }}@github.com/${{ github.repository }}.git
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: 14
- name: Assign MIP number and update file
run: node .github/scripts/rename_and_update_mip.js
- name: Commit MIP number assignment
run: |
git config --local user.name "MIP Bot"
git config --local user.email "[email protected]"
git add -A
if git diff-index --quiet HEAD --; then
echo "No changes to commit"
else
git commit -m "Assign MIP number"
git push origin main
fi