This repository has been archived by the owner on May 10, 2024. It is now read-only.
Merge pull request #22 from odroe/dependabot/pub/path-1.9.0 #115
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check that each package/*/LICENSE is consistent with LICENSE. | |
# | |
# - If it does not exist, make a copy of the LICENSE. | |
# - If there is an inconsistency, overwrite with LICENSE. | |
name: License Consistency | |
on: [push, pull_request] | |
jobs: | |
check: | |
runs-on: ubuntu-latest | |
outputs: | |
result: ${{ steps.check.outputs.result }} | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dart-lang/[email protected] | |
- name: Install dependencies | |
run: dart pub get | |
- name: Fix license consistency | |
run: dart run tools/bin.dart license-consistency -l LICENSE -d packages | |
- name: Check for fix license inconsistency | |
id: check | |
run: | | |
if [[ -n $(git status -s) ]]; then | |
echo "result=failure" >> $GITHUB_OUTPUT | |
else | |
echo "result=success" >> $GITHUB_OUTPUT | |
fi | |
fix: | |
needs: check | |
if: needs.check.outputs.result == 'failure' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: dart-lang/[email protected] | |
- name: Install dependencies | |
run: dart pub get | |
- name: Fix license consistency | |
run: dart run tools/bin.dart license-consistency -l LICENSE -d packages | |
- name: Commit changes | |
run: | | |
git config --local user.email "${{ github.actor }}@users.noreply.github.com" | |
git config --local user.name "${{ github.actor }}" | |
git add . | |
git commit -m "fix(license): Fix license inconsistency" -s | |
- name: Push changes | |
run: git push |