Skip to content

Commit

Permalink
debug ci
Browse files Browse the repository at this point in the history
  • Loading branch information
aburkut committed Oct 20, 2023
1 parent 603ea82 commit de3d37a
Showing 1 changed file with 26 additions and 3 deletions.
29 changes: 26 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,33 @@ jobs:
GITHUB_CONTEXT: ${{ toJson(github) }}
run: echo "$GITHUB_CONTEXT"

- name: Initializing git repository
run: |
git init --initial-branch=main
git remote add origin ${{ github.event.repository.html_url }}
- name: Fetching base and head commit (push)
if: github.event_name == 'push'
env:
PUSHED_COMMITS: ${{ toJSON(github.event.commits) }}
run: |
if [[ ${{ github.event.before }} == 0000000000000000000000000000000000000000 ]]
then
before=$(echo "$PUSHED_COMMITS" | jq .[0].id --raw-output)
git fetch --no-tags --prune --no-recurse-submodules --depth=2 origin $before ${{ github.event.after }}
echo "BASE=$(git rev-parse $before~1)" >> $GITHUB_ENV
else
git fetch --no-tags --prune --no-recurse-submodules --depth=1 origin ${{ github.event.before }} ${{ github.event.after }}
echo "BASE=${{ github.event.before }}" >> $GITHUB_ENV
fi
echo "HEAD=${{ github.event.after }}" >> $GITHUB_ENV
- name: Fetching base and head commit (pull_request)
if: github.event_name == 'pull_request'
run: |
git fetch --no-tags --prune --no-recurse-submodules --depth=$((${{ github.event.pull_request.commits }} + 1)) origin ${{ github.event.pull_request.head.sha }}
git fetch --no-tags --prune --no-recurse-submodules --depth=10 origin ${{ github.event.pull_request.base.sha }}
Expand All @@ -32,9 +58,6 @@ jobs:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 2
ref: ${{ github.event.pull_request.head.sha }}

- name: Setup node
uses: actions/setup-node@v2
Expand Down

0 comments on commit de3d37a

Please sign in to comment.