Skip to content

Commit 3721725

Browse files
authored
fix the ci trigger action (#4805)
* add some more diagnostics * also print the log after fetching [skip-ci] * try using the current ref to fetch and checkout the FETCH_HEAD * add some more options and print the log before checkout * don't add a progress report when printing to a file [skip-ci] * add back the progress report but also use -q [skip-ci] * replace the backticks with tt html tags [skip-ci] * skip the auto-fetch within the action [skip-ci]
1 parent 747fe26 commit 3721725

File tree

5 files changed

+18
-6
lines changed

5 files changed

+18
-6
lines changed

.github/PULL_REQUEST_TEMPLATE.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,5 +11,5 @@
1111
<h3>
1212
Overriding CI behaviors
1313
</h3>
14-
By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a `[test-upstream]` tag to the first line of the commit message. For documentation-only commits, you can skip the CI per commit by adding a `[skip-ci]` tag to the first line of the commit message
14+
By default, the upstream dev CI is disabled on pull request and push events. You can override this behavior per commit by adding a <tt>[test-upstream]</tt> tag to the first line of the commit message. For documentation-only commits, you can skip the CI per commit by adding a <tt>[skip-ci]</tt> tag to the first line of the commit message
1515
</sub>

.github/actions/detect-ci-trigger/script.sh

+11-5
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,17 @@ event_name="$1"
33
keyword="$2"
44

55
echo "::group::fetch a sufficient number of commits"
6-
if [[ "$event_name" == "pull_request" ]]; then
7-
git fetch --deepen=1 --no-tags 2>&1
8-
else
9-
echo "nothing to do."
10-
fi
6+
echo "skipped"
7+
# git log -n 5 2>&1
8+
# if [[ "$event_name" == "pull_request" ]]; then
9+
# ref=$(git log -1 --format='%H')
10+
# git -c protocol.version=2 fetch --deepen=2 --no-tags --prune --progress -q origin $ref 2>&1
11+
# git log FETCH_HEAD
12+
# git checkout FETCH_HEAD
13+
# else
14+
# echo "nothing to do."
15+
# fi
16+
# git log -n 5 2>&1
1117
echo "::endgroup::"
1218

1319
echo "::group::extracting the commit message"

.github/workflows/ci-additional.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
1818
steps:
1919
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 2
2022
- uses: ./.github/actions/detect-ci-trigger
2123
id: detect-trigger
2224
with:

.github/workflows/ci.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,8 @@ jobs:
1717
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
1818
steps:
1919
- uses: actions/checkout@v2
20+
with:
21+
fetch-depth: 2
2022
- uses: ./.github/actions/detect-ci-trigger
2123
id: detect-trigger
2224
with:

.github/workflows/upstream-dev-ci.yaml

+2
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ jobs:
1919
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
2020
steps:
2121
- uses: actions/checkout@v2
22+
with:
23+
fetch-depth: 2
2224
- uses: ./.github/actions/detect-ci-trigger
2325
id: detect-trigger
2426
with:

0 commit comments

Comments
 (0)