3
0
Fork 0
mirror of https://github.com/tj-actions/changed-files synced 2025-01-29 03:34:50 +00:00

Fixed error with test (#270)

* Fixed error with test

* Update action.yml
This commit is contained in:
Tonye Jack 2021-12-04 07:00:44 -05:00 committed by GitHub
parent 3ef3d14e6d
commit 66714ebcad
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 14 additions and 10 deletions

View file

@ -434,15 +434,6 @@ jobs:
echo '${{ toJSON(steps.changed-files-custom-sha.outputs) }}'
shell:
bash
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5
- uses: nrwl/last-successful-commit-action@v1
id: last_successful_commit
with:
branch: ${{ steps.branch-name.outputs.base_ref_branch }}
workflow_id: 'test.yml'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run changed-files with since_last_remote_commit set to true
id: changed-files-since-last-remote-commit
uses: ./
@ -453,12 +444,25 @@ jobs:
echo '${{ toJSON(steps.changed-files-since-last-remote-commit.outputs) }}'
shell:
bash
- name: Get branch name
id: branch-name
uses: tj-actions/branch-names@v5
if: github.event_name == 'pull_request'
- uses: nrwl/last-successful-commit-action@v1
id: last_successful_commit
if: github.event_name == 'pull_request'
with:
branch: ${{ steps.branch-name.outputs.base_ref_branch }}
workflow_id: 'test.yml'
github_token: ${{ secrets.GITHUB_TOKEN }}
- name: Run changed-files with a custom base sha
if: github.event_name == 'pull_request'
id: changed-files-custom-base-sha
uses: ./
with:
base_sha: ${{ steps.last_successful_commit.outputs.commit_hash }}
- name: Show output
if: github.event_name == 'pull_request'
run: |
echo '${{ toJSON(steps.changed-files-custom-base-sha.outputs) }}'
shell:

View file

@ -98,7 +98,7 @@ runs:
# "Set base sha..."
if [[ -n "${{ inputs.base_sha }}" ]]; then
echo "::set-output name=base_sha::${{ inputs.base_sha }}"
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" ]]; then
elif [[ "${{ inputs.since_last_remote_commit }}" == "true" && "${{ github.event.base_ref }}" != "null" ]]; then
echo "::set-output name=base_sha::${{ github.event.before }}"
fi
id: base-sha