Skip to content

Commit

Permalink
license update only in PRs
Browse files Browse the repository at this point in the history
  • Loading branch information
jenschude committed Jan 30, 2024
1 parent ca57dc7 commit beefac6
Showing 1 changed file with 18 additions and 15 deletions.
33 changes: 18 additions & 15 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,24 @@ jobs:
commit_user_name: ct-sdks[bot]
commit_user_email: ${{ steps.get_app_user.outputs.email }}

- name: Check licenses
if: github.event_name == 'push'
run: ./gradlew checkLicense

- uses: stefanzweifel/git-auto-commit-action@e8f94e4dd298db5a6a2aa2d42fe0bcef6f2c9660
id: commit_license_change
if: github.event_name == 'push' && github.ref != 'refs/heads/main'
with:
push_options: --dry-run
file_pattern: 'licenses/index.json licenses/**/index.json'
commit_message: "TASK: Updating license information"
commit_author: ct-sdks[bot] <${{ steps.get_app_user.outputs.email }}>
commit_user_name: ct-sdks[bot]
commit_user_email: ${{ steps.get_app_user.outputs.email }}
disable_globbing: true

- name: Push if changes
if: steps.commit_style_fix.outputs.changes_detected || steps.commit_rev_ignore.outputs.changes_detected
if: steps.commit_style_fix.outputs.changes_detected || steps.commit_rev_ignore.outputs.changes_detected || steps.commit_license_change.outputs.changes_detected
run: git push origin

- name: Run integration tests for PR
Expand Down Expand Up @@ -152,17 +168,4 @@ jobs:

- name: build javadoc
if: github.event_name == 'workflow_dispatch' || github.event_name == 'push' && github.ref == 'refs/heads/main'
run: ./gradlew alljavadoc checkLicense

- uses: stefanzweifel/git-auto-commit-action@e8f94e4dd298db5a6a2aa2d42fe0bcef6f2c9660
id: commit_license_change
if: github.event_name == 'push' && github.ref == 'refs/heads/main'
with:
file_pattern: 'licenses/index.json licenses/**/index.json'
commit_message: "TASK: Updating license information"
commit_author: ct-sdks[bot] <${{ steps.get_app_user.outputs.email }}>
commit_user_name: ct-sdks[bot]
commit_user_email: ${{ steps.get_app_user.outputs.email }}
disable_globbing: true
env:
GITHUB_TOKEN: ${{ steps.generate_github_token.outputs.token }}
run: ./gradlew alljavadoc

0 comments on commit beefac6

Please sign in to comment.