generated from credfeto/cs-template
-
Notifications
You must be signed in to change notification settings - Fork 0
68 lines (63 loc) · 2.1 KB
/
pr-update.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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
name: "PR: Update"
on:
pull_request:
types:
- opened
- reopened
- synchronize
branches:
- main
concurrency:
group: ${{github.workflow}}-${{github.ref}}
cancel-in-progress: false
env:
HEAD_REF: ${{github.head_ref}}
BASE_REF: ${{github.base_ref}}
jobs:
info:
if: ${{endsWith(github.repository , '-template')}}
runs-on: ubuntu-latest
steps:
- name: "Initialise Workspace"
shell: bash
run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE"
- name: "Info"
shell: bash
run: |
echo "Branch: ${{env.HEAD_REF}}"
echo "Base Branch: ${{env.BASE_REF}}"
echo "Repo: ${{github.repository}}"
echo "Owner: ${{github.repository_owner}}"
echo "Assigned: ${{github.event.pull_request.assignee.login}}"
echo "Assigned: ${{github.event.pull_request.assignees[0].login}}"
echo "Last Modified By: ${{github.event.pull_request.head.user.login}}"
echo "PR Creator: ${{github.event.pull_request.creator.login}}"
echo "PR Owner: ${{github.event.pull_request.owner}}"
echo "Actor: ${{github.actor}}"
add-pr-label:
if: ${{github.actor != 'dependabot[bot]'}}
runs-on: ubuntu-latest
steps:
- name: "Initialise Workspace"
shell: bash
run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE"
- uses: actions/labeler@v4
with:
repo-token: ${{secrets.SOURCE_PUSH_TOKEN}}
configuration-path: .github/labeler.yml
sync-labels: true
assign-to-creator:
if: |-
${{!github.event.pull_request.assignee.login
&& github.event_name == 'pull_request'
&& ( github.event.action == 'opened' || github.event.action == 'reopened')
&& github.actor != 'dependabot[bot]'}}
runs-on: ubuntu-latest
steps:
- name: "Initialise Workspace"
shell: bash
run: sudo chown -R "$USER:$USER" "$GITHUB_WORKSPACE"
- name: "Assign PR to the creator"
uses: thomaseizinger/[email protected]
with:
repo-token: ${{secrets.SOURCE_PUSH_TOKEN}}