Skip to content

Commit

Permalink
Merge pull request #822 from tj-actions/feat/replace-all-usage-of-las…
Browse files Browse the repository at this point in the history
…t-successful-commit-action

feat: replace all usage of nrwl/last-successful-commit-action with nrwl/nx-set-shas
  • Loading branch information
repo-ranger[bot] committed Nov 24, 2022
2 parents ba788ed + 5abef67 commit 120c425
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 14 deletions.
9 changes: 4 additions & 5 deletions .github/workflows/test.yml
Expand Up @@ -925,19 +925,18 @@ jobs:
id: branch-name
uses: tj-actions/branch-names@v6
if: github.event_name == 'pull_request'
- uses: nrwl/last-successful-commit-action@v1
- uses: nrwl/nx-set-shas@v3
id: last_successful_commit
if: github.event_name == 'pull_request' && github.event.action != 'closed'
with:
branch: ${{ steps.branch-name.outputs.base_ref_branch }}
workflow_id: 'test.yml'
github_token: ${{ secrets.PAT_TOKEN }}
main-branch-name: ${{ steps.branch-name.outputs.base_ref_branch }}
workflow-id: 'test.yml'
- name: Run changed-files with a custom base sha
if: github.event_name == 'pull_request' && github.event.action != 'closed'
id: changed-files-custom-base-sha
uses: ./
with:
base_sha: ${{ steps.last_successful_commit.outputs.commit_hash }}
base_sha: ${{ steps.last_successful_commit.outputs.base }}
- name: Show output
if: github.event_name == 'pull_request' && github.event.action != 'closed'
run: |
Expand Down
16 changes: 7 additions & 9 deletions README.md
Expand Up @@ -466,18 +466,17 @@ See [inputs](#inputs) for more information.
id: branch-name
uses: tj-actions/branch-names@v6

- uses: nrwl/last-successful-commit-action@v1
- uses: nrwl/nx-set-shas@v3
id: last_successful_commit_push
with:
branch: ${{ steps.branch-name.outputs.current_branch }} # Get the last successful commit for the current branch.
workflow_id: 'test.yml'
github_token: ${{ secrets.GITHUB_TOKEN }}
main-branch-name: ${{ steps.branch-name.outputs.current_branch }} # Get the last successful commit for the current branch.
workflow-id: 'test.yml'

- name: Run changed-files with the commit of the last successful test workflow run
id: changed-files-base-sha-push
uses: tj-actions/changed-files@v34
with:
base_sha: ${{ steps.last_successful_commit_push.outputs.commit_hash }}
base_sha: ${{ steps.last_successful_commit_push.outputs.base }}
...
```

Expand All @@ -494,18 +493,17 @@ See [inputs](#inputs) for more information.
id: branch-name
uses: tj-actions/branch-names@v5

- uses: nrwl/last-successful-commit-action@v1
- uses: nrwl/nx-set-shas@v3
id: last_successful_commit_pull_request
with:
branch: ${{ steps.branch-name.outputs.base_ref_branch }} # Get the last successful commit on master or main branch
main-branch-name: ${{ steps.branch-name.outputs.base_ref_branch }} # Get the last successful commit on master or main branch
workflow_id: 'test.yml'
github_token: ${{ secrets.GITHUB_TOKEN }}

- name: Run changed-files with the commit of the last successful test workflow run on main
id: changed-files-base-sha-pull-request
uses: tj-actions/changed-files@v34
with:
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.commit_hash }}
base_sha: ${{ steps.last_successful_commit_pull_request.outputs.base }}
...
```

Expand Down

0 comments on commit 120c425

Please sign in to comment.