FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-gitlab-submodule/.github/workflows/check_pr_code.yml at main · mertemba/python-gitlab-submodule · GitHub
mertemba
/
python-gitlab-submodule
Public
forked from
ValentinFrancois/python-gitlab-submodule
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Projects
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
python-gitlab-submodule
/
.github
/
workflows
/
check_pr_code.yml
Copy path
View runs
More file actions
More file actions
Latest commit
History
History
History
47 lines (40 loc) · 1.33 KB
Breadcrumbs
python-gitlab-submodule
/
.github
/
workflows
/
check_pr_code.yml
Copy path
File metadata and controls
47 lines (40 loc) · 1.33 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
name
:
PR code check
on
:
pull_request
:
jobs
:
code_checks
:
uses
:
./.github/workflows/_code_checks.yml
count_commits
:
needs
:
code_checks
runs-on
:
ubuntu-latest
outputs
:
n_commits
:
${{ steps.count_commits.outputs.n_commits }}
steps
:
-
name
:
checkout current branch
uses
:
actions/checkout@v2
with
:
fetch-depth
:
0
-
name
:
count commits from main
id
:
count_commits
run
:
|
git fetch
N_COMMITS=$(git rev-list origin/main.. --count)
echo "::set-output name=n_commits::${N_COMMITS}"
add_empty_commit_if_only_one
:
needs
:
count_commits
runs-on
:
ubuntu-latest
#
2 commits because the PR code gets merged into a temp commit on main
if
:
${{ (!!needs.count_commits.outputs.n_commits) && needs.count_commits.outputs.n_commits <= 2 }}
steps
:
-
name
:
checkout current branch
uses
:
actions/checkout@v2
with
:
repository
:
${{ github.event.pull_request.head.repo.full_name }}
ref
:
${{ github.event.pull_request.head.ref }}
-
uses
:
EndBug/add-and-commit@v8
with
:
default_author
:
github_actions
message
:
'
Add empty commit to force use PR title during squash merge
'
commit
:
--allow-empty
add
:
'
.
'
#
working tree should be clean
push
:
true
Back
|
FazBrowse Home
|
New Git URL