-
Notifications
You must be signed in to change notification settings - Fork 35
59 lines (49 loc) · 1.92 KB
/
Copy pathcreate-pr.yaml
File metadata and controls
59 lines (49 loc) · 1.92 KB
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
54
55
56
57
58
59
name: Create PR
# Controls when the action will run. Triggered when another module posts a repository_dispatch event
on:
repository_dispatch:
types: [released]
jobs:
update-modules:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Update modules
run: ./.github/scripts/update-modules.sh ${{ github.event.client_payload.repo }}
env:
GITHUB_USERNAME: ${{ secrets.USERNAME }}
GITHUB_TOKEN: ${{ secrets.TOKEN }}
- name: Generate commit message
id: setup
run: |
TAG=$(echo "${{ github.event.client_payload.ref }}" | sed -E "s~refs/tags/(.*)~\1~g")
PATCH=$(echo "$TAG" | sed -E "s/v{0,1}[0-9]+[.][0-9]+[.]([0-9]+)/\1/g")
if [[ "$PATCH" -eq 0 ]]; then
CHANGE="feature"
else
CHANGE="bug"
fi
if [[ -n "${TAG}" ]]; then
MESSAGE="Updates ${{ github.event.client_payload.repo }} module to $TAG"
else
MESSAGE="Updates ${{ github.event.client_payload.repo }} module"
fi
BODY="${{ github.event.client_payload.repo }}#${{ github.event.client_payload.sha }}"
echo "TAG: $TAG"
echo "CHANGE: $CHANGE"
echo "MESSAGE: $MESSAGE"
echo "::set-output name=message::${MESSAGE}"
echo "::set-output name=body::${BODY}"
echo "::set-output name=change::${CHANGE}"
- name: Create Pull Request
uses: peter-evans/create-pull-request@v3
with:
title: "${{ steps.setup.outputs.message }}"
body: "${{ steps.setup.outputs.body }}"
commit-message: "${{ steps.setup.outputs.message }}"
token: ${{ secrets.TOKEN }}
branch: "${{ github.event.client_payload.repo }}"
delete-branch: true
labels: ${{ steps.setup.outputs.change }},minor
reviewers: ${{ secrets.ASSIGNEES }}
signoff: true