Skip to content

Commit

Permalink
Merge pull request #312 from boozook/ci/fix-update-bump
Browse files Browse the repository at this point in the history
CI: fix bump after update
  • Loading branch information
github-actions[bot] authored Apr 16, 2024
2 parents 50d8daa + 88e6164 commit b515c87
Showing 1 changed file with 43 additions and 3 deletions.
46 changes: 43 additions & 3 deletions .github/workflows/update.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,8 @@ jobs:
echo "Base branch: ${{ needs.new-branch.outputs.base }}"
echo "Working branch: ${{ needs.new-branch.outputs.working }}"
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.new-branch.outputs.working }}

Expand Down Expand Up @@ -224,11 +225,49 @@ jobs:
echo "Pushed: ${{ steps.commit.outputs.pushed }}"
echo "SHA: ${{ steps.commit.outputs.commit_sha }}"
changes:
name: Changes
needs: [new-branch, pre-gen]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: ${{ needs.new-branch.outputs.working }}
fetch-depth: 10

# Maybe better just checkout and then
# git rev-list --ancestry-path ${{ needs.new-branch.outputs.base || github.event.repository.default_branch }}..${{ needs.new-branch.outputs.working }}
# It's faster, simplier and less deps.
- name: Changes
id: changes
continue-on-error: true
uses: tj-actions/changed-files@v44
with:
skip_initial_fetch: "false"
sha: ${{ needs.new-branch.outputs.working }}
base_sha: ${{ needs.new-branch.outputs.base || github.event.repository.default_branch }}

- name: List changed files
if: steps.changes.outcome == 'success'
env:
ALL_CHANGED_FILES: ${{ steps.changes.outputs.all_changed_files }}
run: |
for file in ${ALL_CHANGED_FILES}; do
echo "$file was changed"
done
outputs:
changes: ${{ steps.changes.outputs.all_changed_files }}
changed: ${{ steps.changes.outputs.all_changed_files && 'true' || ' ' }}


bump:
name: Bump
needs: [new-branch, pre-gen]
needs: [new-branch, pre-gen, changes]
runs-on: ubuntu-latest
continue-on-error: true # Workspaces are not supported yet
if: needs.changes.outputs.changed == 'true'
defaults:
run:
shell: bash
Expand Down Expand Up @@ -307,7 +346,8 @@ jobs:

tests:
name: Tests
needs: [new-branch, pre-gen]
needs: [new-branch, pre-gen, changes]
if: needs.changes.outputs.changed == 'true'
uses: ./.github/workflows/tests.yml
secrets: inherit
permissions:
Expand Down

0 comments on commit b515c87

Please sign in to comment.