Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix the ci trigger action #4805

Merged
merged 8 commits into from
Jan 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,5 @@
<h3>
Overriding CI behaviors
</h3>
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
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
</sub>
16 changes: 11 additions & 5 deletions .github/actions/detect-ci-trigger/script.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,17 @@ event_name="$1"
keyword="$2"

echo "::group::fetch a sufficient number of commits"
if [[ "$event_name" == "pull_request" ]]; then
git fetch --deepen=1 --no-tags 2>&1
else
echo "nothing to do."
fi
echo "skipped"
# git log -n 5 2>&1
# if [[ "$event_name" == "pull_request" ]]; then
# ref=$(git log -1 --format='%H')
# git -c protocol.version=2 fetch --deepen=2 --no-tags --prune --progress -q origin $ref 2>&1
# git log FETCH_HEAD
# git checkout FETCH_HEAD
# else
# echo "nothing to do."
# fi
# git log -n 5 2>&1
echo "::endgroup::"

echo "::group::extracting the commit message"
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci-additional.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: ./.github/actions/detect-ci-trigger
id: detect-trigger
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: ./.github/actions/detect-ci-trigger
id: detect-trigger
with:
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/upstream-dev-ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,8 @@ jobs:
triggered: ${{ steps.detect-trigger.outputs.trigger-found }}
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 2
- uses: ./.github/actions/detect-ci-trigger
id: detect-trigger
with:
Expand Down