Open
Description
I'm trying to detect changes on the main branch when merging a PR into the main branch. I kept on getting
Error: The process '/usr/bin/git' failed with exit code 128
I've solved it by
- Checking out the repository beforehand
- Manually grabbing the previous commit sha and saving it to an environment variable
- Using the commit sha as a base for the query.
Surely I'm over complicating this, and there is a simpler way to do this?
on:
push:
branches:
- main
workflow_dispatch:
steps:
- name: Checkout repository
uses: actions/checkout@v2
with:
ref: ${{ github.ref }}
fetch-depth: 2
- name: Get previous commit SHA
id: prev_commit
run: echo "PREV_COMMIT_SHA=$(git rev-parse HEAD~1)" >> $GITHUB_ENV
- uses: dorny/paths-filter@v2
id: filter
with:
base: ${{ env.PREV_COMMIT_SHA }}
filters: |
changed:
- 'example**'
Metadata
Metadata
Assignees
Labels
No labels